fixes error propagation for macros.parseExpr

This commit is contained in:
Araq 2014-11-13 09:12:27 +01:00
commit bc5879b9b7
2 changed files with 5 additions and 2 deletions

View file

@ -1172,6 +1172,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
of opcQueryErrorFlag: of opcQueryErrorFlag:
createStr regs[ra] createStr regs[ra]
regs[ra].node.strVal = c.errorFlag regs[ra].node.strVal = c.errorFlag
c.errorFlag.setLen 0
of opcCallSite: of opcCallSite:
ensureKind(rkNode) ensureKind(rkNode)
if c.callsite != nil: regs[ra].node = c.callsite if c.callsite != nil: regs[ra].node = c.callsite

View file

@ -1,5 +1,5 @@
discard """ discard """
outputsub: '''Error: invalid indentation''' outputsub: '''Error: invalid indentation 45'''
""" """
# feature request #1473 # feature request #1473
@ -12,6 +12,8 @@ macro test(text: string): expr =
result = newLit getCurrentExceptionMsg() result = newLit getCurrentExceptionMsg()
const const
valid = 45
a = test("foo&&") a = test("foo&&")
b = test("valid")
echo a echo a, " ", b