mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 16:47:28 +01:00
Change the "for" keyword to "while".
The semantics is closer to C's "while". Also, "while" is simpler, which means simpler interactions with assertions, pre- and post-conditions.
This commit is contained in:
1 parent
de28a715b3
commit
e87ff7163b
5 files changed
+18
-18
No files matched your search
+2
-2
@@ -387,7 +387,7 @@ func (p *parser) parseStatement1() (*a.Node, error) {
|
||||
p.src = p.src[1:]
|
||||
return a.NewContinue().Node(), nil
|
||||
|
||||
case t.IDFor:
|
||||
case t.IDWhile:
|
||||
p.src = p.src[1:]
|
||||
condition, err := (*a.Expr)(nil), error(nil)
|
||||
if p.peekID() != t.IDOpenCurly {
|
||||
@@ -400,7 +400,7 @@ func (p *parser) parseStatement1() (*a.Node, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return a.NewFor(condition, body).Node(), nil
|
||||
return a.NewWhile(condition, body).Node(), nil
|
||||
|
||||
case t.IDIf:
|
||||
o, err := p.parseIf()
|
||||
|
||||
Reference in new issue
Block a user