summaryrefslogtreecommitdiff
path: root/src/parser.cc
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2015-01-04 10:01:23 -0500
committerAdrian Thurston <thurston@complang.org>2015-01-04 10:01:23 -0500
commitbce5c95fa055b7523349e1824d906b0debe4178e (patch)
treebb98a0054fec999c405c6d0f30bf8099cf6283de /src/parser.cc
parent650b70f4a55af12ee1ebb22a9afdd9fba7a3b626 (diff)
downloadcolm-bce5c95fa055b7523349e1824d906b0debe4178e.tar.gz
don't allocate a constructor for parse statements
Just need a consItemList for the list of items we are going to parse.
Diffstat (limited to 'src/parser.cc')
-rw-r--r--src/parser.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/parser.cc b/src/parser.cc
index 8606254a..95ddbc40 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -553,13 +553,8 @@ LangExpr *BaseParser::parseCmd( const InputLoc &loc, bool tree, bool stop,
{
LangExpr *expr = 0;
- /* We are constructing a parser, sending it items, then returning it.
- * Thisis the constructor for the parser. */
- ConsItemList *emptyConsItemList = new ConsItemList;
-
- Constructor *constructor = Constructor::cons( loc, curNspace(),
- emptyConsItemList, pd->nextPatConsId++ );
- pd->replList.append( constructor );
+ /* Item list for what we are sending to the parser. */
+ ConsItemList *consItemList = new ConsItemList;
/* The parser may be referenced. */
LangVarRef *varRef = 0;
@@ -579,7 +574,7 @@ LangExpr *BaseParser::parseCmd( const InputLoc &loc, bool tree, bool stop,
LangTerm::ParseTreeType : LangTerm::ParseType );
expr = LangExpr::cons( LangTerm::cons( loc, langTermType,
- varRef, objField, parserTypeRef, fieldInitVect, constructor,
+ varRef, objField, parserTypeRef, fieldInitVect, consItemList,
parserText ) );
/* Check for redeclaration. */
@@ -896,7 +891,7 @@ void BaseParser::structHead( const InputLoc &loc,
inNspace->structDefList.append( context );
/* Make the namespace for the struct. */
- Namespace *structNspace = createNamespace( loc, data );
+ createNamespace( loc, data );
}
StmtList *BaseParser::appendStatement( StmtList *stmtList, LangStmt *stmt )