diff options
author | Araq <rumpf_a@web.de> | 2014-06-30 22:24:08 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-06-30 22:24:08 +0200 |
commit | 0339b9d386bd0efa3c31bd05c25cd9ed0f1c7dd5 (patch) | |
tree | c6e28c8401a78e5d9fd04fec89a65e2cfbe51681 /tests | |
parent | b89495ef0f6bb60a3296fbaa7c4397dcd269f73d (diff) | |
download | Nim-0339b9d386bd0efa3c31bd05c25cd9ed0f1c7dd5.tar.gz |
fixes #1319
Diffstat (limited to 'tests')
-rw-r--r-- | tests/macros/tbindsym.nim | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/macros/tbindsym.nim b/tests/macros/tbindsym.nim new file mode 100644 index 000000000..e1e3b5112 --- /dev/null +++ b/tests/macros/tbindsym.nim @@ -0,0 +1,25 @@ +discard """ + output: '''TFoo +TBar''' +""" + +# bug #1319 + +import macros + +type + TTextKind = enum + TFoo, TBar + +macro test: stmt = + var x = @[TFoo, TBar] + result = newStmtList() + for i in x: + result.add newCall(newIdentNode("echo"), + case i + of TFoo: + bindSym("TFoo") + of TBar: + bindSym("TBar")) + +test() |