Repository navigation
Conversation
…hain can parse
dag_grammar_expr_expr is an ordered Choice that offered match_expr, if_expr and
loop_expr before binary_expr. But dag_grammar_primary_expr_core's final three
alternatives already ARE those productions, so a block-shaped expression is a
legal binary operand by construction. The ordering denied it: given
`match a { ... } && b` the choice committed to match_expr, which succeeded
having consumed the match alone, and `&& b` reached no production -- the parse
ended with tokens remaining. Nothing was unrepresentable; the alternative that
represents it was never offered.
fn_literal, block_expr and arrow_lambda stay above binary_expr, where they
already were: primary_expr_core admits a braced field-initializer list, so a
block offered below could be taken as a record literal instead. The first tokens
of match/if/loop are disjoint from those three, so moving them below changes
nothing between them.
Evidence, against the live grammar rather than a model of it: the new witness
v2.test.parse.block_expr_as_binary_operand_parse runs source text through
dag_prepared_grammar. Two arms are red before this change -- a match and an if
heading a binary chain -- and three controls are green on both sides: each block
form standing alone, and an operand that was never block-shaped. Whole-corpus
census moves 829 file refusals to 650; 193 leave the parse stage and 14 of those
land deeper, at body lowering or normalize, which is the signature of a wall
moving back rather than vanishing.
Not established, and stated rather than assumed: that a bare block form produces
the same NODE as before, since the controls assert parsing and not shape; and
whether the trailing match/if/loop alternatives are now unreachable, which holds
exactly if binary_expr never fails where they would succeed. They are retained
rather than deleted because that argument is not made here.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Ledger-Repair-Judged: docs/design-rung-drops.md Heal-Candidate-Run: 35542724612
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An ordering fact, not a missing form
dag_grammar_expr_expris an orderedChoicethat offeredmatch_expr,if_exprandloop_exprbeforebinary_expr. Butdag_grammar_primary_expr_core's final three alternatives already are those same productions — a block-shaped expression is a legal binary operand by construction.The ordering denied it. Given
match a { ... } && b, the choice committed tomatch_expr, which succeeded having consumed the match alone, and&& breached no production: the parse ended with tokens remaining. Nothing was unrepresentable; the alternative that represents it was never offered.A discriminating pair, against the live parser
New witness
v2.test.parse.block_expr_as_binary_operand_parseruns source text throughdag_prepared_grammar— the grammar under judgment, not a model of it.match a {…} && trueif a {…} else {…} && truematch· bareif·a && trueThe three controls are what make this a repair rather than a trade: a change that satisfied the reds by making block forms parse only as operands would take them red.
The population
Whole-corpus
census, same native binary both sides:193 files left the parse stage; 14 of those now fail deeper. Net −179. That signature — the wall moving back rather than vanishing — is what a correct parse repair looks like, and the net is the honest headline, not the parse figure.
What is NOT verified
Tree shape. The controls assert that a bare
match/ifstill parses, not that it yields the same node. A bare match now routesbinary_expr → primary_expr_core → match_exprrather than straight tomatch_expr; ifbinary_exprwith zero operators wraps instead of collapsing to its operand, every bare block form in the corpus changes shape. The census is indirect evidence against it — normalize runs, no new refusals — but it is not a structural assertion. The idiom to close it exists: the siblingexpression_bodied_fn_decl_parse_testasserts on the parsed node viafind_arrow_body_child. I'd take that before calling this done, and will add it on request.Deadness of the trailing alternatives.
match_expr/if_expr/loop_exprnow sit belowbinary_exprand are unreachable exactly ifbinary_exprnever fails where they would succeed. That argument is not made here, so they are retained rather than deleted, and the annotation says so.fn_literal,block_exprandarrow_lambdastay abovebinary_expr, where they already were:primary_expr_coreadmits a braced field-initializer list, so a block offered below could be read as a record literal.🤖 Generated with Claude Code