Files
Nim/tests/macros/ttryparseexpr.nim
cooldome 862897dc0f Support for stmtListExpr in parser after major keywords. Scaled down version. (#10852)
* Support for stmtListExpr in parser after major keywords
* fixes #4035
2019-03-18 11:09:49 +01:00

22 lines
394 B
Nim

discard """
outputsub: '''Error: expression expected, but found '[EOF]' -- 45'''
"""
# feature request #1473
import macros
macro test(text: string): untyped =
try:
result = parseExpr(text.strVal)
except ValueError:
echo text
result = newLit getCurrentExceptionMsg()
const
valid = 45
a = test("foo&&")
b = test("valid")
c = test("\"") # bug #2504
echo a, " -- ", b