fixes #3313
This commit is contained in:
parent
eb7f514933
commit
5b2f54ffa1
4 changed files with 15 additions and 6 deletions
|
|
@ -1636,7 +1636,9 @@ proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
|
|||
# watch out, hacks ahead:
|
||||
let oldErrorCount = msgs.gErrorCounter
|
||||
let oldErrorMax = msgs.gErrorMax
|
||||
inc c.inCompilesContext
|
||||
let oldCompilesId = c.inCompilesContext
|
||||
inc c.compilesContextIdGenerator
|
||||
c.inCompilesContext = c.compilesContextIdGenerator
|
||||
# do not halt after first error:
|
||||
msgs.gErrorMax = high(int)
|
||||
|
||||
|
|
@ -1660,6 +1662,7 @@ proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
|
|||
except ERecoverableError:
|
||||
discard
|
||||
# undo symbol table changes (as far as it's possible):
|
||||
c.inCompilesContext = oldCompilesId
|
||||
c.generics = oldGenerics
|
||||
c.inGenericContext = oldInGenericContext
|
||||
c.inUnrolledContext = oldInUnrolledContext
|
||||
|
|
@ -1668,7 +1671,6 @@ proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
|
|||
msgs.setInfoContextLen(oldContextLen)
|
||||
setLen(gOwners, oldOwnerLen)
|
||||
c.currentScope = oldScope
|
||||
dec c.inCompilesContext
|
||||
errorOutputs = oldErrorOutputs
|
||||
msgs.gErrorCounter = oldErrorCount
|
||||
msgs.gErrorMax = oldErrorMax
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue