include custom object modules
This commit is contained in:
parent
abb29d12f3
commit
0e27404baf
|
|
@ -359,28 +359,31 @@ final class FirstPass : ASTVisitor
|
||||||
dec.accept(this);
|
dec.accept(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
override void visit(const Module mod)
|
override void visit(const Module mod)
|
||||||
{
|
{
|
||||||
rootSymbol = allocateSemanticSymbol(null, CompletionKind.moduleName,
|
rootSymbol = allocateSemanticSymbol(null, CompletionKind.moduleName,
|
||||||
symbolFile);
|
symbolFile);
|
||||||
currentSymbol = rootSymbol;
|
currentSymbol = rootSymbol;
|
||||||
moduleScope = GCAllocator.instance.make!Scope(0, uint.max);
|
moduleScope = GCAllocator.instance.make!Scope(0, uint.max);
|
||||||
currentScope = moduleScope;
|
currentScope = moduleScope;
|
||||||
auto objectLocation = cache.resolveImportLocation("object");
|
auto objectLocations = cache.resolveImportLocations("object");
|
||||||
if (objectLocation is null)
|
if (objectLocations is null)
|
||||||
warning("Could not locate object.d or object.di");
|
warning("Could not locate object.d or object.di");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto objectImport = allocateSemanticSymbol(IMPORT_SYMBOL_NAME,
|
foreach (objectLocation; objectLocations)
|
||||||
CompletionKind.importSymbol, objectLocation);
|
{
|
||||||
objectImport.acSymbol.skipOver = true;
|
auto objectImport = allocateSemanticSymbol(IMPORT_SYMBOL_NAME,
|
||||||
currentSymbol.addChild(objectImport, true);
|
CompletionKind.importSymbol, objectLocation);
|
||||||
currentScope.addSymbol(objectImport.acSymbol, false);
|
objectImport.acSymbol.skipOver = true;
|
||||||
}
|
currentSymbol.addChild(objectImport, true);
|
||||||
foreach (s; builtinSymbols[])
|
currentScope.addSymbol(objectImport.acSymbol, false);
|
||||||
currentScope.addSymbol(s, false);
|
}
|
||||||
mod.accept(this);
|
}
|
||||||
}
|
foreach (s; builtinSymbols[])
|
||||||
|
currentScope.addSymbol(s, false);
|
||||||
|
mod.accept(this);
|
||||||
|
}
|
||||||
|
|
||||||
override void visit(const EnumDeclaration dec)
|
override void visit(const EnumDeclaration dec)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue