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)
|
foreach (bind; importDeclaration.importBindings.importBinds)
|
||||||
{
|
{
|
||||||
Tuple!(string, string) bindTuple;
|
Tuple!(string, string) bindTuple;
|
||||||
bindTuple[0] = internString(bind.left.text);
|
if (bind.right == tok!"")
|
||||||
bindTuple[1] = bind.right == tok!"" ? null : internString(bind.right.text);
|
{
|
||||||
|
bindTuple[1] = internString(bind.left.text);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bindTuple[0] = internString(bind.left.text);
|
||||||
|
bindTuple[1] = internString(bind.right.text);
|
||||||
|
}
|
||||||
info.importedSymbols.insert(bindTuple);
|
info.importedSymbols.insert(bindTuple);
|
||||||
}
|
}
|
||||||
info.isPublic = protection == tok!"public";
|
info.isPublic = protection == tok!"public";
|
||||||
|
|
|
@ -171,7 +171,7 @@ private:
|
||||||
|
|
||||||
foreach (tup; importInfo.importedSymbols[])
|
foreach (tup; importInfo.importedSymbols[])
|
||||||
{
|
{
|
||||||
ACSymbol needle = ACSymbol(tup[0]);
|
ACSymbol needle = ACSymbol(tup[1]);
|
||||||
ACSymbol* sym;
|
ACSymbol* sym;
|
||||||
auto r = symbol.parts.equalRange(&needle);
|
auto r = symbol.parts.equalRange(&needle);
|
||||||
if (r.empty) foreach (sy; symbol.parts[])
|
if (r.empty) foreach (sy; symbol.parts[])
|
||||||
|
@ -187,9 +187,9 @@ private:
|
||||||
sym = r.front;
|
sym = r.front;
|
||||||
if (sym is null)
|
if (sym is null)
|
||||||
continue;
|
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);
|
sym.kind, sym.type);
|
||||||
s.parts.insert(sym.parts[]);
|
s.parts.insert(sym.parts[]);
|
||||||
s.callTip = sym.callTip;
|
s.callTip = sym.callTip;
|
||||||
|
|
Loading…
Reference in New Issue