summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-02-17 08:26:44 +0100
committerAraq <rumpf_a@web.de>2014-02-17 08:26:44 +0100
commit3ec29738757c4b8eb0a7071333a0351d802e30a6 (patch)
tree89779c41bbb74827d296153217d4a6aee628a68b /tests
parent350a49cc26803bc38a3c83d469f8deaeecf0f112 (diff)
downloadNim-3ec29738757c4b8eb0a7071333a0351d802e30a6.tar.gz
fixes #926
Diffstat (limited to 'tests')
-rw-r--r--tests/macros/tvarnimnode.nim19
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