From b2f577df23d5daae873df18ff345965f8dc7e47b Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 12 Nov 2014 02:36:59 +0100 Subject: fixes #1473 --- tests/macros/ttryparseexpr.nim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/macros/ttryparseexpr.nim (limited to 'tests/macros') 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 -- cgit 1.4.1-2-gfad0