summary refs log tree commit diff stats
path: root/tests/macros
diff options
context:
space:
mode:
authorPMunch <peterme@peterme.net>2017-07-26 00:37:37 +0200
committerAndreas Rumpf <rumpf_a@web.de>2017-07-26 00:37:37 +0200
commite00953cbc08b0eed3fec6044216e5764c85da076 (patch)
tree3510bbd37d9e3ea222a142286dc3cae1c1ef6866 /tests/macros
parentce341982a6b19def86744ed8ff080a7899ae148b (diff)
downloadNim-e00953cbc08b0eed3fec6044216e5764c85da076.tar.gz
Added codeRepr and dumpCode to the macros module. (#5778)
Diffstat (limited to 'tests/macros')
-rw-r--r--tests/macros/tdumpastgen.nim25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/macros/tdumpastgen.nim b/tests/macros/tdumpastgen.nim
new file mode 100644
index 000000000..faed77225
--- /dev/null
+++ b/tests/macros/tdumpastgen.nim
@@ -0,0 +1,25 @@
+discard """
+msg: '''nnkStmtList.newTree(
+  nnkVarSection.newTree(
+    nnkIdentDefs.newTree(
+      newIdentNode(!"x"),
+      newEmptyNode(),
+      nnkCall.newTree(
+        nnkDotExpr.newTree(
+          newIdentNode(!"foo"),
+          newIdentNode(!"create")
+        ),
+        newLit(56)
+      )
+    )
+  )
+)'''
+"""
+
+# disabled; can't work as the output is done by the compiler
+
+import macros
+
+dumpAstGen:
+  var x = foo.create(56)
+