mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 08:52:18 +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
@@ -63,7 +63,7 @@ func TestCheck(t *testing.T) {
|
||||
var i i32
|
||||
var j i32[0:8]
|
||||
|
||||
for i == j {
|
||||
while i == j {
|
||||
}
|
||||
}
|
||||
`) + "\n"
|
||||
|
||||
+2
-2
@@ -78,8 +78,8 @@ func (c *typeChecker) checkStatement(n *a.Node) error {
|
||||
}
|
||||
return nil
|
||||
|
||||
case a.KFor:
|
||||
o := n.For()
|
||||
case a.KWhile:
|
||||
o := n.While()
|
||||
if cond := o.Condition(); cond != nil {
|
||||
if err := c.checkExpr(cond); err != nil {
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user