You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement while, for, and loop parsing. All three keywords lex but have no parse production today; each fails with "expected expression".
Part of the v0.6.x parser-completeness work (see crates/AGENTS.md "Implemented subset"). Surfaced during PR #57 verification.
Spec
§5 control flow; §16 while_expr / for_expr / loop_expr, plus while let (§5.4) and for destructuring (§5.5).
The block-head restriction applies to the while condition and the for iterable (§5.1/§5.2, §16) — reuse the cond_expr helper from PR Start lexer parser compiler bootstrap #57.
Scope
while cond { ... } and while let pat = expr { ... }.
for pat in iter { ... } with destructuring patterns.
loop { ... }.
Confirm break / continue (already statements) nest correctly inside these; evaluate break value if §5 allows it.
AST nodes; corpus fixtures from §5 examples; unit tests incl. the condition/iterable restriction.
Notes
while let and for depend on pattern parsing — coordinate with the match issue so patterns land once and are shared.
Summary
Implement
while,for, andloopparsing. All three keywords lex but have no parse production today; each fails with "expected expression".Part of the v0.6.x parser-completeness work (see
crates/AGENTS.md"Implemented subset"). Surfaced during PR #57 verification.Spec
while_expr/for_expr/loop_expr, pluswhile let(§5.4) andfordestructuring (§5.5).whilecondition and theforiterable (§5.1/§5.2, §16) — reuse thecond_exprhelper from PR Start lexer parser compiler bootstrap #57.Scope
while cond { ... }andwhile let pat = expr { ... }.for pat in iter { ... }with destructuring patterns.loop { ... }.break/continue(already statements) nest correctly inside these; evaluatebreak valueif §5 allows it.Notes
while letandfordepend on pattern parsing — coordinate with thematchissue so patterns land once and are shared.