diff options
author | Araq <rumpf_a@web.de> | 2014-02-17 08:26:44 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-02-17 08:26:44 +0100 |
commit | 3ec29738757c4b8eb0a7071333a0351d802e30a6 (patch) | |
tree | 89779c41bbb74827d296153217d4a6aee628a68b /tests | |
parent | 350a49cc26803bc38a3c83d469f8deaeecf0f112 (diff) | |
download | Nim-3ec29738757c4b8eb0a7071333a0351d802e30a6.tar.gz |
fixes #926
Diffstat (limited to 'tests')
-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 |