mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 16:32:11 +01:00
Add a yield keyword
This commit is contained in:
1 parent
93665d50fe
commit
65dcf6a5b9
19 files changed
+122
-89
No files matched your search
+2
-2
@@ -612,7 +612,7 @@ func (p *parser) parseStatement1() (*a.Node, error) {
|
||||
}
|
||||
return a.NewIterate(label, unroll, vars, asserts, body).Node(), nil
|
||||
|
||||
case t.KeyReturn:
|
||||
case t.KeyReturn, t.KeyYield:
|
||||
p.src = p.src[1:]
|
||||
value, err := (*a.Expr)(nil), error(nil)
|
||||
if p.peek1().Key() != t.KeySemicolon {
|
||||
@@ -621,7 +621,7 @@ func (p *parser) parseStatement1() (*a.Node, error) {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return a.NewReturn(value).Node(), nil
|
||||
return a.NewRet(x, value).Node(), nil
|
||||
|
||||
case t.KeyVar:
|
||||
p.src = p.src[1:]
|
||||
|
||||
Reference in new issue
Block a user