agent: builder model: opus max_turns: 110 budget_usd: 22 effort: high —

Brief: #557 step 3, the grammar language gets same_line

Blocks: the parser grammar port (#557 step 4: parser/mod.rs, 2,728 Rust lines, the largest file left in Rust)

Score: decided (ADR-339 D2, Part II 10.8 table row same_line); steps 1-2 are on develop (2ca9841, 9545797). One built-in, checker and lowering.

Facts: Where things live, Traps already met, Commands

Decided

Facts

To build

  1. same_line in the checker (arity 0, binds nothing; a grammar’s own rule same_line wins) and in the lowering as above. Tests, each a .nika with its .stdout in tests/compiler/tests/: grammar_same_line.nika (postfix = name (same_line "[" n "]" | same_line "(" n ")")* over text and over Bytes: a\n[0], f\n(x) are not an index / call, a [0], f (x) are; a backtracking case: an alternative that skips the break and fails, then one asking same_line at the same place gives the same answer) and grammar_same_line_own_ws.nika (own rule WS = (multispace1 | "//" until(line_ending) | "/*" until("*/") "*/")*: a // c\n[0] not an index, a /* c */ [0] an index, a /*\n*/ [0] not an index). One commit with the lowered files, Part of #557.

Done when

tests/compiler with both settings (emit_* changed), it tests filtered on grammar, the builder gate, clippy, lower-std fixpoint.

Stop and report if

winnow-grammar cannot carry a state in a generated grammar over input bytes, or its entries cannot be handed one (say what it offers); an existing test’s .stdout/.stderr changes; a change in grammar_run.rs, build_time.rs or parser/mod.rs is needed.

This site is open source. Improve this page.