fixes #1380
This commit is contained in:
parent
1deb9820f5
commit
e935a35bcf
1 changed files with 8 additions and 9 deletions
|
|
@ -1374,19 +1374,18 @@ proc lookUpForDefined(c: PContext, n: PNode, onlyCurrentScope: bool): PSym =
|
||||||
if onlyCurrentScope: return
|
if onlyCurrentScope: return
|
||||||
checkSonsLen(n, 2)
|
checkSonsLen(n, 2)
|
||||||
var m = lookUpForDefined(c, n.sons[0], onlyCurrentScope)
|
var m = lookUpForDefined(c, n.sons[0], onlyCurrentScope)
|
||||||
if (m != nil) and (m.kind == skModule):
|
if m != nil and m.kind == skModule:
|
||||||
if (n.sons[1].kind == nkIdent):
|
let ident = considerQuotedIdent(n[1])
|
||||||
var ident = n.sons[1].ident
|
|
||||||
if m == c.module:
|
if m == c.module:
|
||||||
result = strTableGet(c.topLevelScope.symbols, ident)
|
result = strTableGet(c.topLevelScope.symbols, ident)
|
||||||
else:
|
else:
|
||||||
result = strTableGet(m.tab, ident)
|
result = strTableGet(m.tab, ident)
|
||||||
else:
|
|
||||||
localError(n.sons[1].info, errIdentifierExpected, "")
|
|
||||||
of nkAccQuoted:
|
of nkAccQuoted:
|
||||||
result = lookUpForDefined(c, considerQuotedIdent(n), onlyCurrentScope)
|
result = lookUpForDefined(c, considerQuotedIdent(n), onlyCurrentScope)
|
||||||
of nkSym:
|
of nkSym:
|
||||||
result = n.sym
|
result = n.sym
|
||||||
|
of nkOpenSymChoice, nkClosedSymChoice:
|
||||||
|
result = n.sons[0].sym
|
||||||
else:
|
else:
|
||||||
localError(n.info, errIdentifierExpected, renderTree(n))
|
localError(n.info, errIdentifierExpected, renderTree(n))
|
||||||
result = nil
|
result = nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue