summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-09-05 08:21:01 +0200
committerGitHub <noreply@github.com>2019-09-05 08:21:01 +0200
commit58bcf6cd46fe9108f2dced59c612153d2951aee2 (patch)
treee485be2b109f7a75295f20faa779676ccf4f188d /lib
parentc2ba0ee144adfaea6f2e1cc93a20d022149f6ccf (diff)
downloadNim-58bcf6cd46fe9108f2dced59c612153d2951aee2.tar.gz
fixes #12121 (#12126)
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/pegs.nim7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/pure/pegs.nim b/lib/pure/pegs.nim
index 844fbd13c..7ce65b438 100644
--- a/lib/pure/pegs.nim
+++ b/lib/pure/pegs.nim
@@ -890,12 +890,13 @@ macro mkHandlerTplts(handlers: untyped): untyped =
   #           <handler code block>
   #   ...
   proc mkEnter(hdName, body: NimNode): NimNode =
-    quote do:
-      template `hdName`(s, p, start) =
+    template helper(hdName, body) {.dirty.} =
+      template hdName(s, p, start) =
         let s {.inject.} = s
         let p {.inject.} = p
         let start {.inject.} = start
-        `body`
+        body
+    result = getAst(helper(hdName, body))
 
   template mkLeave(hdPostf, body) {.dirty.} =
     # this has to be dirty to be able to capture *result* as *length* in