mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-12 06:49:02 +02:00
Merged dmdfe 2.031.
This commit is contained in:
@@ -99,7 +99,7 @@ Module::Module(char *filename, Identifier *ident, int doDocComment, int doHdrGen
|
||||
searchCacheSymbol = NULL;
|
||||
searchCacheFlags = 0;
|
||||
semanticstarted = 0;
|
||||
semanticdone = 0;
|
||||
semanticRun = 0;
|
||||
decldefs = NULL;
|
||||
vmoduleinfo = NULL;
|
||||
#if IN_DMD
|
||||
@@ -770,25 +770,32 @@ void Module::semantic(Scope* unused_sc)
|
||||
// Add all symbols into module's symbol table
|
||||
symtab = new DsymbolTable();
|
||||
for (i = 0; i < members->dim; i++)
|
||||
{ Dsymbol *s;
|
||||
|
||||
s = (Dsymbol *)members->data[i];
|
||||
{ Dsymbol *s = (Dsymbol *)members->data[i];
|
||||
s->addMember(NULL, sc->scopesym, 1);
|
||||
}
|
||||
|
||||
/* Set scope for the symbols so that if we forward reference
|
||||
* a symbol, it can possibly be resolved on the spot.
|
||||
* If this works out well, it can be extended to all modules
|
||||
* before any semantic() on any of them.
|
||||
*/
|
||||
for (i = 0; i < members->dim; i++)
|
||||
{ Dsymbol *s = (Dsymbol *)members->data[i];
|
||||
s->setScope(sc);
|
||||
}
|
||||
|
||||
// Pass 1 semantic routines: do public side of the definition
|
||||
for (i = 0; i < members->dim; i++)
|
||||
{ Dsymbol *s;
|
||||
{ Dsymbol *s = (Dsymbol *)members->data[i];
|
||||
|
||||
s = (Dsymbol *)members->data[i];
|
||||
//printf("\tModule('%s'): '%s'.semantic()\n", toChars(), s->toChars());
|
||||
s->semantic(sc);
|
||||
runDeferredSemantic();
|
||||
}
|
||||
|
||||
sc = sc->pop();
|
||||
sc->pop();
|
||||
semanticdone = semanticstarted;
|
||||
sc->pop(); // 2 pops because Scope::createGlobal() created 2
|
||||
semanticRun = semanticstarted;
|
||||
//printf("-Module::semantic(this = %p, '%s'): parent = %p\n", this, toChars(), parent);
|
||||
}
|
||||
|
||||
@@ -827,7 +834,7 @@ void Module::semantic2(Scope* unused_sc)
|
||||
|
||||
sc = sc->pop();
|
||||
sc->pop();
|
||||
semanticdone = semanticstarted;
|
||||
semanticRun = semanticstarted;
|
||||
//printf("-Module::semantic2('%s'): parent = %p\n", toChars(), parent);
|
||||
}
|
||||
|
||||
@@ -857,7 +864,7 @@ void Module::semantic3(Scope* unused_sc)
|
||||
|
||||
sc = sc->pop();
|
||||
sc->pop();
|
||||
semanticdone = semanticstarted;
|
||||
semanticRun = semanticstarted;
|
||||
}
|
||||
|
||||
void Module::inlineScan()
|
||||
@@ -882,7 +889,7 @@ void Module::inlineScan()
|
||||
|
||||
s->inlineScan();
|
||||
}
|
||||
semanticdone = semanticstarted;
|
||||
semanticRun = semanticstarted;
|
||||
}
|
||||
|
||||
/****************************************************
|
||||
@@ -1143,11 +1150,14 @@ DsymbolTable *Package::resolve(Array *packages, Dsymbol **pparent, Package **ppk
|
||||
else
|
||||
{
|
||||
assert(p->isPackage());
|
||||
#if TARGET_NET //dot net needs modules and packages with same name
|
||||
#else
|
||||
if (p->isModule())
|
||||
{ p->error("module and package have the same name");
|
||||
fatal();
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
parent = p;
|
||||
dst = ((Package *)p)->symtab;
|
||||
|
||||
Reference in New Issue
Block a user