diff options
author | Araq <rumpf_a@web.de> | 2018-09-03 11:19:18 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-09-03 11:19:18 +0200 |
commit | 47cbe0e54db77b262205fb0bd209d4c8e0345b58 (patch) | |
tree | 985cf8c89aa736623b6da7b7eaa4c1607034d603 /compiler/importer.nim | |
parent | e0fd1cdb5fda1dd3e2e38d7741dcb899c9c5d5bb (diff) | |
download | Nim-47cbe0e54db77b262205fb0bd209d4c8e0345b58.tar.gz |
fixes #8852
Diffstat (limited to 'compiler/importer.nim')
-rw-r--r-- | compiler/importer.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/importer.nim b/compiler/importer.nim index 739759794..73d2e6599 100644 --- a/compiler/importer.nim +++ b/compiler/importer.nim @@ -170,8 +170,8 @@ proc myImportModule(c: PContext, n: PNode; importStmtResult: PNode): PSym = suggestSym(c.config, n.info, result, c.graph.usageSym, false) importStmtResult.add newStrNode(toFullPath(c.config, f), n.info) -proc transformImportAs(n: PNode): PNode = - if n.kind == nkInfix and n.sons[0].ident.s == "as": +proc transformImportAs(c: PContext; n: PNode): PNode = + if n.kind == nkInfix and considerQuotedIdent(c, n[0]).s == "as": result = newNodeI(nkImportAs, n.info) result.add n.sons[1] result.add n.sons[2] @@ -179,7 +179,7 @@ proc transformImportAs(n: PNode): PNode = result = n proc impMod(c: PContext; it: PNode; importStmtResult: PNode) = - let it = transformImportAs(it) + let it = transformImportAs(c, it) let m = myImportModule(c, it, importStmtResult) if m != nil: var emptySet: IntSet @@ -215,7 +215,7 @@ proc evalImport(c: PContext, n: PNode): PNode = proc evalFrom(c: PContext, n: PNode): PNode = result = newNodeI(nkImportStmt, n.info) checkMinSonsLen(n, 2, c.config) - n.sons[0] = transformImportAs(n.sons[0]) + n.sons[0] = transformImportAs(c, n.sons[0]) var m = myImportModule(c, n.sons[0], result) if m != nil: n.sons[0] = newSymNode(m) @@ -227,7 +227,7 @@ proc evalFrom(c: PContext, n: PNode): PNode = proc evalImportExcept*(c: PContext, n: PNode): PNode = result = newNodeI(nkImportStmt, n.info) checkMinSonsLen(n, 2, c.config) - n.sons[0] = transformImportAs(n.sons[0]) + n.sons[0] = transformImportAs(c, n.sons[0]) var m = myImportModule(c, n.sons[0], result) if m != nil: n.sons[0] = newSymNode(m) |