Fix #11
This commit is contained in:
parent
13ef990fa9
commit
506573b493
|
@ -199,7 +199,7 @@ final class FirstPass : ASTVisitor
|
|||
foreach (Attribute attr; dec.attributes)
|
||||
{
|
||||
if (isProtection(attr.attribute))
|
||||
p = attr.attribute;
|
||||
protection = attr.attribute;
|
||||
}
|
||||
dec.accept(this);
|
||||
protection = p;
|
||||
|
@ -284,6 +284,7 @@ final class FirstPass : ASTVisitor
|
|||
{
|
||||
ImportInformation info;
|
||||
info.modulePath = convertChainToImportPath(single.identifierChain);
|
||||
info.isPublic = protection == TokenType.public_;
|
||||
currentScope.importInformation ~= info;
|
||||
}
|
||||
if (importDeclaration.importBindings is null) return;
|
||||
|
@ -298,6 +299,7 @@ final class FirstPass : ASTVisitor
|
|||
bindTuple[1] = bind.right == TokenType.invalid ? null : bind.right.value.dup;
|
||||
info.importedSymbols ~= bindTuple;
|
||||
}
|
||||
info.isPublic = protection == TokenType.public_;
|
||||
currentScope.importInformation ~= info;
|
||||
}
|
||||
|
||||
|
@ -339,7 +341,6 @@ private:
|
|||
|
||||
void visitAggregateDeclaration(AggType)(AggType dec, CompletionKind kind)
|
||||
{
|
||||
|
||||
// Log.trace("visiting aggregate declaration ", dec.name.value);
|
||||
SemanticSymbol* symbol = new SemanticSymbol(dec.name.value.dup,
|
||||
kind, symbolFile, dec.name.startIndex);
|
||||
|
@ -502,6 +503,11 @@ private:
|
|||
if (importInfo.importedSymbols.length == 0)
|
||||
{
|
||||
currentScope.symbols ~= symbols;
|
||||
if (importInfo.isPublic && currentScope.parent is null)
|
||||
{
|
||||
Log.trace("Public import");
|
||||
rootSymbol.acSymbol.parts ~= symbols;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
symbolLoop: foreach (symbol; symbols)
|
||||
|
@ -522,9 +528,15 @@ private:
|
|||
s.location = symbol.location;
|
||||
s.symbolFile = symbol.symbolFile;
|
||||
currentScope.symbols ~= s;
|
||||
if (importInfo.isPublic && currentScope.parent is null)
|
||||
rootSymbol.acSymbol.parts ~= s;
|
||||
}
|
||||
else
|
||||
{
|
||||
currentScope.symbols ~= symbol;
|
||||
if (importInfo.isPublic && currentScope.parent is null)
|
||||
rootSymbol.acSymbol.parts ~= symbol;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -717,7 +729,7 @@ private:
|
|||
|
||||
const(ACSymbol)*[] convertAstToSymbols(const(Token)[] tokens, string symbolFile)
|
||||
{
|
||||
Module m = parseModuleSimple(tokens, null);
|
||||
Module m = parseModuleSimple(tokens, symbolFile);
|
||||
|
||||
FirstPass first = new FirstPass(m, symbolFile);
|
||||
first.run();
|
||||
|
|
2
dscanner
2
dscanner
|
@ -1 +1 @@
|
|||
Subproject commit 1c057260d5541f2ebd4d5b1780bacf45e482df39
|
||||
Subproject commit e3819643bbec121e16abda6f980cc096d2e7f4f1
|
|
@ -69,7 +69,7 @@ struct ModuleCache
|
|||
estimate = symbol.estimateMemory(estimate);
|
||||
}
|
||||
double megabytes = estimate / (1024.0F * 1024.0F);
|
||||
Log.info("Memory use estimated at ", megabytes, " megabytes");
|
||||
Log.trace("Memory use estimated at ", megabytes, " megabytes");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue