diff options
author | Araq <rumpf_a@web.de> | 2014-11-12 02:36:59 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-11-12 02:36:59 +0100 |
commit | b2f577df23d5daae873df18ff345965f8dc7e47b (patch) | |
tree | 2307ab50c5aa1c3cd2f7d56dfda817bcf05a3da1 /tests/macros | |
parent | 2d43fcafe0cedd4f78611dddccc31e1bef432aab (diff) | |
download | Nim-b2f577df23d5daae873df18ff345965f8dc7e47b.tar.gz |
fixes #1473
Diffstat (limited to 'tests/macros')
-rw-r--r-- | tests/macros/ttryparseexpr.nim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/macros/ttryparseexpr.nim b/tests/macros/ttryparseexpr.nim new file mode 100644 index 000000000..2a6f4437d --- /dev/null +++ b/tests/macros/ttryparseexpr.nim @@ -0,0 +1,17 @@ +discard """ + outputsub: '''Error: invalid indentation''' +""" + +# feature request #1473 +import macros + +macro test(text: string): expr = + try: + result = parseExpr(text.strVal) + except ValueError: + result = newLit getCurrentExceptionMsg() + +const + a = test("foo&&") + +echo a |