summaryrefslogtreecommitdiff
path: root/src/declare.cc
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2015-01-04 09:32:08 -0500
committerAdrian Thurston <thurston@complang.org>2015-01-04 09:32:08 -0500
commit650b70f4a55af12ee1ebb22a9afdd9fba7a3b626 (patch)
tree6bdcebe0091aed9936964cf37b4670ba21a7ef3c /src/declare.cc
parente682fbd4a5f83142ada2aa92d7a642035c010348 (diff)
downloadcolm-650b70f4a55af12ee1ebb22a9afdd9fba7a3b626.tar.gz
no longer allocating a langEl to generics
enerics are now structs. Also added the TYPE_GERERIC unique type.
Diffstat (limited to 'src/declare.cc')
-rw-r--r--src/declare.cc44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/declare.cc b/src/declare.cc
index 2a7077f4..d93a2e64 100644
--- a/src/declare.cc
+++ b/src/declare.cc
@@ -284,27 +284,27 @@ void GenericType::declare( Compiler *pd, Namespace *nspace )
{
//std::cout << "generic " << g->name << std::endl;
- LangEl *langEl = declareLangEl( pd, nspace, name, LangEl::NonTerm );
-
- /* Add one empty production. */
- ProdElList *emptyList = new ProdElList;
- //addProduction( g->loc, langEl, emptyList, false, 0, 0 );
-
- {
- LangEl *prodName = langEl;
- assert( prodName->type == LangEl::NonTerm );
-
- Production *newDef = Production::cons( InputLoc(), prodName,
- emptyList, String(), false, 0,
- pd->prodList.length(), prodName->defList.length() );
-
- prodName->defList.append( newDef );
- pd->prodList.append( newDef );
- newDef->predOf = 0;
- }
-
- langEl->generic = this;
- this->langEl = langEl;
+// LangEl *langEl = declareLangEl( pd, nspace, name, LangEl::NonTerm );
+
+// /* Add one empty production. */
+// ProdElList *emptyList = new ProdElList;
+// //addProduction( g->loc, langEl, emptyList, false, 0, 0 );
+//
+// {
+// LangEl *prodName = langEl;
+// assert( prodName->type == LangEl::NonTerm );
+//
+// Production *newDef = Production::cons( InputLoc(), prodName,
+// emptyList, String(), false, 0,
+// pd->prodList.length(), prodName->defList.length() );
+//
+// prodName->defList.append( newDef );
+// pd->prodList.append( newDef );
+// newDef->predOf = 0;
+// }
+//
+// langEl->generic = this;
+// this->langEl = langEl;
utArg = typeArg->uniqueType;
@@ -334,7 +334,7 @@ void GenericType::declare( Compiler *pd, Namespace *nspace )
break;
}
- langEl->objectDef = objDef;
+// langEl->objectDef = objDef;
}
void Namespace::declare( Compiler *pd )