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:
2026-08-08 17:15:20 +09:00
parent d78137a051
commit bbdd8bede6
3 changed files with 27 additions and 5 deletions

View File

@@ -1,13 +1,13 @@
package wwfixture;
def protocolversion: i32 = 1;
def corpuscount: i32 = 1730;
def corpuscount: i32 = 1731;
def errorcount: i32 = 343;
def compilecount: i32 = 22;
def runcount: i32 = 209;
def runexitcount: i32 = 1156;
def nativecount: i32 = 3460;
def corpushash: str = "5c20c19b826359fcceb45c8db5cf405f39183a68783582eaaf5f38f0e88f3771";
def runexitcount: i32 = 1157;
def nativecount: i32 = 3462;
def corpushash: str = "6786916caba20c07c47eaaa0507dd2707fd162b708904b6e72187afb02233bf9";
type directive = enum i32 {
ERROR = 0,