Summary
block_inner treats any non-semicolon-terminated expression as the block tail and stops, so a block-like expression used in statement position (if … {}, match … {}, { … }, loops) must currently be the tail or carry an explicit trailing ;. A statement-position block expression followed by more statements fails to parse (e.g. if c { a(); } more();).
Surfaced during PR #57 verification; documented in crates/AGENTS.md.
Spec
- §5: block-like expressions (
if, match, loops, blocks) used in statement position do not require a trailing ; (Rust precedent). §16 statement vs. expression-statement grammar.
Scope
Notes
Cleanest after match and the loop constructs land, so the "is this block-like?" check covers them in one place. Can land for if only first, then extend.
Summary
block_innertreats any non-semicolon-terminated expression as the block tail and stops, so a block-like expression used in statement position (if … {},match … {},{ … }, loops) must currently be the tail or carry an explicit trailing;. A statement-position block expression followed by more statements fails to parse (e.g.if c { a(); } more();).Surfaced during PR #57 verification; documented in
crates/AGENTS.md.Spec
if,match, loops, blocks) used in statement position do not require a trailing;(Rust precedent). §16 statement vs. expression-statement grammar.Scope
block_inner, recognize block-like expressions (if/match/while/for/loop/{}) in statement position and continue parsing subsequent statements without requiring;.if-statement followed by further statements.if(extend tomatch/loops as they land).Notes
Cleanest after
matchand the loop constructs land, so the "is this block-like?" check covers them in one place. Can land forifonly first, then extend.