Fix renamed imports
This commit is contained in:
parent
698808d553
commit
7ec5aaf65a
|
@ -366,8 +366,15 @@ final class FirstPass : ASTVisitor
|
|||
foreach (bind; importDeclaration.importBindings.importBinds)
|
||||
{
|
||||
Tuple!(string, string) bindTuple;
|
||||
bindTuple[0] = internString(bind.left.text);
|
||||
bindTuple[1] = bind.right == tok!"" ? null : internString(bind.right.text);
|
||||
if (bind.right == tok!"")
|
||||
{
|
||||
bindTuple[1] = internString(bind.left.text);
|
||||
}
|
||||
else
|
||||
{
|
||||
bindTuple[0] = internString(bind.left.text);
|
||||
bindTuple[1] = internString(bind.right.text);
|
||||
}
|
||||
info.importedSymbols.insert(bindTuple);
|
||||
}
|
||||
info.isPublic = protection == tok!"public";
|
||||
|
|
|
@ -171,7 +171,7 @@ private:
|
|||
|
||||
foreach (tup; importInfo.importedSymbols[])
|
||||
{
|
||||
ACSymbol needle = ACSymbol(tup[0]);
|
||||
ACSymbol needle = ACSymbol(tup[1]);
|
||||
ACSymbol* sym;
|
||||
auto r = symbol.parts.equalRange(&needle);
|
||||
if (r.empty) foreach (sy; symbol.parts[])
|
||||
|
@ -187,9 +187,9 @@ private:
|
|||
sym = r.front;
|
||||
if (sym is null)
|
||||
continue;
|
||||
if (tup[1] !is null)
|
||||
if (tup[0] !is null)
|
||||
{
|
||||
ACSymbol* s = allocate!ACSymbol(symbolAllocator, tup[1],
|
||||
ACSymbol* s = allocate!ACSymbol(symbolAllocator, tup[0],
|
||||
sym.kind, sym.type);
|
||||
s.parts.insert(sym.parts[]);
|
||||
s.callTip = sym.callTip;
|
||||
|
|
Loading…
Reference in New Issue