Files
Nim/tests/macros/ttryparseexpr.nim
cooldome 7d8af25d58 revert parser stmtListExpr (#11007)
* Revert "Support for stmtListExpr in parser after major keywords. Scaled down version. (#10852)"

This reverts commit 862897dc0f.

* redo fix for #4035

* render stmtlistExpr using semicolon

* Revert "render stmtlistExpr using semicolon"

This reverts commit cafb78b8d5.

* revert test
2019-04-17 11:55:41 +02:00

21 lines
374 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:
result = newLit getCurrentExceptionMsg()
const
valid = 45
a = test("foo&&")
b = test("valid")
c = test("\"") # bug #2504
echo a, " ", b