mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 00:47:28 +01:00
Prohibit iterate loops inside coroutines
This commit is contained in:
1 parent
79ce1a7b0e
commit
14f5859311
3 files changed
+5
-22
No files matched your search
+3
-1
@@ -1204,7 +1204,9 @@ func (p *parser) parseIf() (*a.If, error) {
|
||||
}
|
||||
|
||||
func (p *parser) parseIterateNode() (*a.Node, error) {
|
||||
if x := p.peek1(); x != t.IDIterate {
|
||||
if p.funcEffect.Coroutine() {
|
||||
return nil, fmt.Errorf(`parse: "iterate" inside coroutine at %s:%d`, p.filename, p.line())
|
||||
} else if x := p.peek1(); x != t.IDIterate {
|
||||
got := p.tm.ByID(x)
|
||||
return nil, fmt.Errorf(`parse: expected "iterate", got %q at %s:%d`, got, p.filename, p.line())
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user