diff options
Diffstat (limited to 'tests/macros/tvarnimnode.nim')
-rw-r--r-- | tests/macros/tvarnimnode.nim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/macros/tvarnimnode.nim b/tests/macros/tvarnimnode.nim new file mode 100644 index 000000000..73fcc16ea --- /dev/null +++ b/tests/macros/tvarnimnode.nim @@ -0,0 +1,19 @@ +discard """ + output: 10 +""" + +#bug #926 + +import macros + +proc test(f: var PNimrodNode) {.compileTime.} = + f = newNimNode(nnkStmtList) + f.add newCall(newIdentNode("echo"), newLit(10)) + +macro blah(prc: stmt): stmt = + result = prc + + test(result) + +proc test() {.blah.} = + echo 5 |