summaryrefslogtreecommitdiff
path: root/src/resolve.cc
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2014-01-03 20:01:19 -0500
committerAdrian Thurston <thurston@complang.org>2014-01-03 20:01:19 -0500
commit3931778574d48c9c6eed17c2651d5d1e668edb15 (patch)
treeee15a081392dbca3413ac21f8a05cc3fa76fac4c /src/resolve.cc
parentbcec8b03bf45820555631046a19862d4306a33b9 (diff)
downloadcolm-3931778574d48c9c6eed17c2651d5d1e668edb15.tar.gz
some prep for lookup using parsed var ref namespace
Diffstat (limited to 'src/resolve.cc')
-rw-r--r--src/resolve.cc22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/resolve.cc b/src/resolve.cc
index 5f080c8d..1eee603d 100644
--- a/src/resolve.cc
+++ b/src/resolve.cc
@@ -28,10 +28,22 @@ using std::cout;
using std::cerr;
using std::endl;
+Namespace *TypeRef::lookupNspace( Compiler *pd )
+{
+// if ( parsedVarRef != 0 && !nspaceQual->thisOnly() ) {
+// std::cerr << "parsed var ref is present" << std:: endl;
+// UniqueType *ut = parsedVarRef->lookup( pd );
+// nspace = ut->langEl->nspace;
+// }
+// else {
+ /* Lookup up the qualifiction and then the name. */
+ return nspaceQual->getQual( pd );
+// }
+}
+
UniqueType *TypeRef::lookupTypeName( Compiler *pd )
{
- /* Lookup up the qualifiction and then the name. */
- nspace = nspaceQual->getQual( pd );
+ nspace = lookupNspace( pd );
if ( nspace == 0 )
error(loc) << "do not have region for resolving reference" << endp;
@@ -64,7 +76,7 @@ UniqueType *TypeRef::lookupTypeName( Compiler *pd )
UniqueType *TypeRef::lookupTypeLiteral( Compiler *pd )
{
/* Lookup up the qualifiction and then the name. */
- nspace = nspaceQual->getQual( pd );
+ nspace = lookupNspace( pd );
if ( nspace == 0 )
error(loc) << "do not have region for resolving reference" << endp;
@@ -607,8 +619,6 @@ void Compiler::resolvePreEof( TokenRegion *region )
void Compiler::resolveRootBlock()
{
- rootLocalFrame->resolve( this );
-
CodeBlock *block = rootCodeBlock;
block->resolve( this );
}
@@ -652,6 +662,8 @@ void Compiler::resolveParseTree()
/* Compile the init code */
resolveRootBlock( );
+ rootLocalFrame->resolve( this );
+
/* Init all user object fields (need consistent size). */
for ( LelList::Iter lel = langEls; lel.lte(); lel++ ) {
ObjectDef *objDef = lel->objectDef;