diff options
author | Araq <rumpf_a@web.de> | 2014-08-19 20:42:48 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-08-19 20:42:48 +0200 |
commit | e935a35bcf97aaf34d9ef0edb016a9dd3c0894a1 (patch) | |
tree | 4fdc7cc1785e7c982f5bf9cccfb1fcadf621b9ab | |
parent | 1deb9820f5473afc1469064488f4ed45a2aabb55 (diff) | |
download | Nim-e935a35bcf97aaf34d9ef0edb016a9dd3c0894a1.tar.gz |
fixes #1380
-rw-r--r-- | compiler/semexprs.nim | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index aadcdb2f4..da12ec08c 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1374,20 +1374,19 @@ proc lookUpForDefined(c: PContext, n: PNode, onlyCurrentScope: bool): PSym = if onlyCurrentScope: return checkSonsLen(n, 2) var m = lookUpForDefined(c, n.sons[0], onlyCurrentScope) - if (m != nil) and (m.kind == skModule): - if (n.sons[1].kind == nkIdent): - var ident = n.sons[1].ident - if m == c.module: - result = strTableGet(c.topLevelScope.symbols, ident) - else: - result = strTableGet(m.tab, ident) + if m != nil and m.kind == skModule: + let ident = considerQuotedIdent(n[1]) + if m == c.module: + result = strTableGet(c.topLevelScope.symbols, ident) else: - localError(n.sons[1].info, errIdentifierExpected, "") + result = strTableGet(m.tab, ident) of nkAccQuoted: result = lookUpForDefined(c, considerQuotedIdent(n), onlyCurrentScope) of nkSym: result = n.sym - else: + of nkOpenSymChoice, nkClosedSymChoice: + result = n.sons[0].sym + else: localError(n.info, errIdentifierExpected, renderTree(n)) result = nil |