disallow 'continue' that is not used within a loop; fixes #6367
This commit is contained in:
parent
c64391e30b
commit
604dfebee0
1 changed files with 1 additions and 1 deletions
|
|
@ -66,7 +66,7 @@ proc semBreakOrContinue(c: PContext, n: PNode): PNode =
|
||||||
localError(c.config, n.info, errInvalidControlFlowX % s.name.s)
|
localError(c.config, n.info, errInvalidControlFlowX % s.name.s)
|
||||||
else:
|
else:
|
||||||
localError(c.config, n.info, errGenerated, "'continue' cannot have a label")
|
localError(c.config, n.info, errGenerated, "'continue' cannot have a label")
|
||||||
elif (c.p.nestedLoopCounter <= 0) and (c.p.nestedBlockCounter <= 0):
|
elif (c.p.nestedLoopCounter <= 0) and ((c.p.nestedBlockCounter <= 0) or n.kind == nkContinueStmt):
|
||||||
localError(c.config, n.info, errInvalidControlFlowX %
|
localError(c.config, n.info, errInvalidControlFlowX %
|
||||||
renderTree(n, {renderNoComments}))
|
renderTree(n, {renderNoComments}))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue