mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
fixes error propagation for macros.parseExpr
This commit is contained in:
@@ -1172,6 +1172,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||
of opcQueryErrorFlag:
|
||||
createStr regs[ra]
|
||||
regs[ra].node.strVal = c.errorFlag
|
||||
c.errorFlag.setLen 0
|
||||
of opcCallSite:
|
||||
ensureKind(rkNode)
|
||||
if c.callsite != nil: regs[ra].node = c.callsite
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
outputsub: '''Error: invalid indentation'''
|
||||
outputsub: '''Error: invalid indentation 45'''
|
||||
"""
|
||||
|
||||
# feature request #1473
|
||||
@@ -12,6 +12,8 @@ macro test(text: string): expr =
|
||||
result = newLit getCurrentExceptionMsg()
|
||||
|
||||
const
|
||||
valid = 45
|
||||
a = test("foo&&")
|
||||
b = test("valid")
|
||||
|
||||
echo a
|
||||
echo a, " ", b
|
||||
|
||||
Reference in New Issue
Block a user