summary refs log tree commit diff stats
path: root/tests/accept/compile/teval1.nim
diff options
context:
space:
mode:
authordom96 <dominikpicheta@googlemail.com>2011-05-14 20:35:17 +0100
committerdom96 <dominikpicheta@googlemail.com>2011-05-14 20:35:17 +0100
commit4fd42d5150fa97d934d782f43433dd2ca2a49b3f (patch)
tree6bfa52cfc246b79801179b00463f017bb2d4a09b /tests/accept/compile/teval1.nim
parentd1cd1cea345e82ff1f8b55803b81d68a86cb9d50 (diff)
parent3e9dcc8be5d1286e3647e8f665f456966aa02437 (diff)
downloadNim-4fd42d5150fa97d934d782f43433dd2ca2a49b3f.tar.gz
Merge branch 'master' of github.com:Araq/Nimrod
Diffstat (limited to 'tests/accept/compile/teval1.nim')
-rw-r--r--tests/accept/compile/teval1.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/accept/compile/teval1.nim b/tests/accept/compile/teval1.nim
new file mode 100644
index 000000000..8172ebe28
--- /dev/null
+++ b/tests/accept/compile/teval1.nim
@@ -0,0 +1,19 @@
+import macros
+
+proc testProc: string {.compileTime.} =
+  result = ""
+  result = result & ""
+
+when true:
+  macro test(n: stmt): stmt =
+    result = newNimNode(nnkStmtList)
+    echo "#", testProc(), "#"
+  test:
+    "hi"
+
+const
+  x = testProc()
+  
+echo "##", x, "##"
+
+