diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-09-05 08:21:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-05 08:21:01 +0200 |
commit | 58bcf6cd46fe9108f2dced59c612153d2951aee2 (patch) | |
tree | e485be2b109f7a75295f20faa779676ccf4f188d /lib | |
parent | c2ba0ee144adfaea6f2e1cc93a20d022149f6ccf (diff) | |
download | Nim-58bcf6cd46fe9108f2dced59c612153d2951aee2.tar.gz |
fixes #12121 (#12126)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/pegs.nim | 7 |
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 |