fixes #1511
This commit is contained in:
parent
e766c7c3cd
commit
b7f8dbbec2
1 changed files with 16 additions and 13 deletions
|
|
@ -23,6 +23,7 @@ proc semBreakOrContinue(c: PContext, n: PNode): PNode =
|
|||
result = n
|
||||
checkSonsLen(n, 1)
|
||||
if n.sons[0].kind != nkEmpty:
|
||||
if n.kind != nkContinueStmt:
|
||||
var s: PSym
|
||||
case n.sons[0].kind
|
||||
of nkIdent: s = lookUp(c, n.sons[0])
|
||||
|
|
@ -36,6 +37,8 @@ proc semBreakOrContinue(c: PContext, n: PNode): PNode =
|
|||
suggestSym(x.info, s)
|
||||
else:
|
||||
localError(n.info, errInvalidControlFlowX, s.name.s)
|
||||
else:
|
||||
localError(n.info, errGenerated, "'continue' cannot have a label")
|
||||
elif (c.p.nestedLoopCounter <= 0) and (c.p.nestedBlockCounter <= 0):
|
||||
localError(n.info, errInvalidControlFlowX,
|
||||
renderTree(n, {renderNoComments}))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue