summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-09-11 08:02:26 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-09-16 12:12:44 +0200
commit3f87453981bb534b1761f8979a23115b56edfd5b (patch)
tree3c4fcdc369e36509070280e1d0fd9c7c77a5849e
parent1c03604ec6da398fe1d200c955271e473674d76d (diff)
downloadNim-3f87453981bb534b1761f8979a23115b56edfd5b.tar.gz
fixes a weird quote do regression
-rw-r--r--compiler/semexprs.nim3
-rw-r--r--lib/core/macros.nim2
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index eb5b8d2c1..1ab43d84f 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -2019,7 +2019,8 @@ proc semQuoteAst(c: PContext, n: PNode): PNode =
   var tmpl = semTemplateDef(c, dummyTemplate)
   quotes[0] = tmpl[namePos]
   # This adds a call to newIdentNode("result") as the first argument to the template call
-  quotes[1] = newNode(nkCall, n.info, @[newIdentNode(getIdent(c.cache, "newIdentNode"), n.info), newStrNode(nkStrLit, "result")])
+  let identNode = getCompilerProc(c.graph, "newIdentNode")
+  quotes[1] = newNode(nkCall, n.info, @[identNode.newSymNode, newStrNode(nkStrLit, "result")])
   result = newNode(nkCall, n.info, @[
      createMagic(c.graph, "getAst", mExpandToAst).newSymNode,
     newNode(nkCall, n.info, quotes)])
diff --git a/lib/core/macros.nim b/lib/core/macros.nim
index 2e1eeb042..b0414153e 100644
--- a/lib/core/macros.nim
+++ b/lib/core/macros.nim
@@ -446,7 +446,7 @@ proc newIdentNode*(i: NimIdent): NimNode {.compileTime, deprecated.} =
 
 {.pop.}
 
-proc newIdentNode*(i: string): NimNode {.magic: "StrToIdent", noSideEffect.}
+proc newIdentNode*(i: string): NimNode {.magic: "StrToIdent", noSideEffect, compilerproc.}
   ## creates an identifier node from `i`. It is simply an alias for
   ## ``ident(string)``. Use that, it's shorter.