mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 00:32:11 +01:00
Ban continue in a double-curly while loop
This commit is contained in:
1 parent
b791b441ef
commit
161fa6ae4a
1 file changed
+6
-1
+6
-1
@@ -816,7 +816,12 @@ func (p *parser) parseStatement1() (*a.Node, error) {
|
||||
return nil, fmt.Errorf(`parse: expected endwhile%s at %s:%d`,
|
||||
dotLabel, p.filename, p.line())
|
||||
}
|
||||
if doubleCurly && !a.Terminates(body) {
|
||||
if !doubleCurly {
|
||||
// No-op.
|
||||
} else if n.HasContinue() {
|
||||
return nil, fmt.Errorf(`parse: double {{ }} while loop has explicit continue at %s:%d`,
|
||||
p.filename, p.line())
|
||||
} else if !a.Terminates(body) {
|
||||
return nil, fmt.Errorf(`parse: double {{ }} while loop doesn't terminate at %s:%d`,
|
||||
p.filename, p.line())
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user