fixes #1473
This commit is contained in:
parent
2d43fcafe0
commit
b2f577df23
9 changed files with 104 additions and 26 deletions
17
tests/macros/ttryparseexpr.nim
Normal file
17
tests/macros/ttryparseexpr.nim
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue