syntax: accept the empty for () condition (align up to cstage)
cstage parse.c:1027 accepts `for ()` — N_FOR with a nil cond, no
for-else arm, no test emitted (an unconditional loop; a deliberate
Go-flavored ww divergence from Hare, original to the toolchain
import). The wwstage parser had no RPAREN early-out and rejected it.
Selfhost checker and cgen already nil-guard n.cond, so the parser arm
is the whole gap. Graduates the held e2e row (pin 1731/1157/3462).
Adjacent asymmetries left filed, not fixed here (rule 11): the brace
form `for { }`, the empty middle clause of the 3-clause form, and
the REVERSE case (wwstage accepts 2-clause `for (cond; post)` which
cstage rejects).
This commit is contained in:
11
test/wcc/data/r700_break_loop/case.ww
Normal file
11
test/wcc/data/r700_break_loop/case.ww
Normal file
@@ -0,0 +1,11 @@
|
||||
//ww:run-exit 7
|
||||
// Migrated from 700_e2e row 23.
|
||||
package main;
|
||||
fn main() i32 = {
|
||||
let i: i32 = 0;
|
||||
for () {
|
||||
i += 1;
|
||||
if (i == 7) { break; };
|
||||
};
|
||||
return i;
|
||||
};
|
||||
Reference in New Issue
Block a user