diff options
author | Adrian Thurston <thurston@complang.org> | 2014-01-06 20:17:58 -0500 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2014-01-06 20:17:58 -0500 |
commit | 4f9b5d9846e279ec546298ef99faf95cac21e183 (patch) | |
tree | de7d5507ed21f7f885e07c28a153a0e6307d0677 /src/loadinit.cc | |
parent | 95a688ad149ab1c579d358daacd06d609b517dd6 (diff) | |
download | colm-4f9b5d9846e279ec546298ef99faf95cac21e183.tar.gz |
added wrapper function for current namespace
Diffstat (limited to 'src/loadinit.cc')
-rw-r--r-- | src/loadinit.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/loadinit.cc b/src/loadinit.cc index 1330ac6d..6cc76b03 100644 --- a/src/loadinit.cc +++ b/src/loadinit.cc @@ -68,7 +68,7 @@ void LoadInit::walkProdElList( String defName, ProdElList *list, prod_el_list &p repeatType = RepeatRepeat; ProdEl *prodEl = prodElName( internal, typeName, - NamespaceQual::cons(namespaceStack.top()), + NamespaceQual::cons( curNspace() ), captureField, repeatType, false ); appendProdEl( list, prodEl ); @@ -269,7 +269,7 @@ void LoadInit::walkDefinition( item &define ) LelDefList *defList = new LelDefList; walkProdList( name, defList, ProdList ); - NtDef *ntDef = NtDef::cons( name, namespaceStack.top(), curContext(), false ); + NtDef *ntDef = NtDef::cons( name, curNspace(), curContext(), false ); ObjectDef *objectDef = ObjectDef::cons( ObjectDef::UserType, name, pd->nextObjectId++ ); cflDef( ntDef, objectDef, defList ); } @@ -277,7 +277,7 @@ void LoadInit::walkDefinition( item &define ) void LoadInit::consParseStmt( StmtList *stmtList ) { /* Parse the "start" def. */ - NamespaceQual *nspaceQual = NamespaceQual::cons( namespaceStack.top() ); + NamespaceQual *nspaceQual = NamespaceQual::cons( curNspace() ); TypeRef *typeRef = TypeRef::cons( internal, nspaceQual, String("start"), RepeatNone ); /* Pop argv, this yields the file name . */ @@ -322,7 +322,7 @@ void LoadInit::consExportTree( StmtList *stmtList ) LangVarRef *varRef = LangVarRef::cons( internal, 0, curLocalFrame->rootScope, qual, String("P") ); LangExpr *expr = LangExpr::cons( LangTerm::cons( internal, LangTerm::VarRefType, varRef ) ); - NamespaceQual *nspaceQual = NamespaceQual::cons( namespaceStack.top() ); + NamespaceQual *nspaceQual = NamespaceQual::cons( curNspace() ); TypeRef *typeRef = TypeRef::cons( internal, nspaceQual, String("start"), RepeatNone ); ObjectField *program = ObjectField::cons( internal, typeRef, String("ColmTree") ); LangStmt *programExport = exportStmt( program, LangStmt::AssignType, expr ); @@ -335,7 +335,7 @@ void LoadInit::consExportError( StmtList *stmtList ) LangVarRef *varRef = LangVarRef::cons( internal, 0, curLocalFrame->rootScope, qual, String("error") ); LangExpr *expr = LangExpr::cons( LangTerm::cons( internal, LangTerm::VarRefType, varRef ) ); - NamespaceQual *nspaceQual = NamespaceQual::cons( namespaceStack.top() ); + NamespaceQual *nspaceQual = NamespaceQual::cons( curNspace() ); TypeRef *typeRef = TypeRef::cons( internal, nspaceQual, String("str"), RepeatNone ); ObjectField *program = ObjectField::cons( internal, typeRef, String("ColmError") ); LangStmt *programExport = exportStmt( program, LangStmt::AssignType, expr ); |