fixes a weird quote do regression

This commit is contained in:
Andreas Rumpf
2019-09-11 08:02:26 +02:00
parent 1c03604ec6
commit 3f87453981
2 changed files with 3 additions and 2 deletions

View File

@@ -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)])

View File

@@ -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.