summary refs log tree commit diff stats
path: root/tests/macros/tdumptree.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/macros/tdumptree.nim')
-rw-r--r--tests/macros/tdumptree.nim27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/macros/tdumptree.nim b/tests/macros/tdumptree.nim
new file mode 100644
index 000000000..f540306c4
--- /dev/null
+++ b/tests/macros/tdumptree.nim
@@ -0,0 +1,27 @@
+discard """
+nimout: '''
+StmtList
+  VarSection
+    IdentDefs
+      Ident "x"
+      Empty
+      Call
+        DotExpr
+          Ident "foo"
+          Ident "create"
+        IntLit 56'''
+"""
+
+# disabled; can't work as the output is done by the compiler
+
+import macros
+
+#emit("type\n  TFoo = object\n    bar: int")
+
+#var f: TFoo
+#f.bar = 5
+#echo(f.bar)
+
+dumpTree:
+  var x = foo.create(56)
+