fix(syntax): Carp's comma is whitespace, not unquote, in the cross-dialect pin - #108
Merged
Conversation
…alect pin `main` was broken by a semantic conflict between two PRs that were each green alone and merged cleanly. #106 added `hy_comma_arm_does_not_change_other_dialects`, asserting `,` still yields `ReaderPrefix::Unquote` in every dialect but Clojure -- including Carp, which at the time inherited the legacy reader where that was true. #104 then split Carp out and made `,` **whitespace**, which is what Carp actually does: `[min, max, val]` and `[x Int, y Int]` are separator syntax, and reading the commas as unquote gave `max` and `val` phantom prefixes at 39 corpus sites. Neither PR could have caught this. git saw no textual conflict, both CI runs were green, and the collision only exists once both are on the same tree. Carp moves from the unquote loop into the whitespace loop beside Clojure, and the test's doc comment now records why -- it previously said the split-out arm "still serves `Unknown` and `Carp`", which #104 made false.
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.
mainis currently broken —cargo test --workspacefails onsexpr::tests::parser::hy_comma_arm_does_not_change_other_dialects.cargo test --test clistill passes, which is why it wasn't caught earlier.A semantic conflict between two PRs that were each green alone
hy_comma_arm_does_not_change_other_dialects, asserting,still yieldsReaderPrefix::Unquotein every dialect but Clojure — including Carp, which at the time inherited the legacy reader where that was true.,whitespace, which is what Carp actually does:[min, max, val]and[x Int, y Int]are separator syntax, and reading those commas as unquote gavemaxandvalphantomUnquoteprefixes at 39 corpus sites.Neither PR could have caught it. git saw no textual conflict, both CI runs were green, and the collision only exists once both are on the same tree. This is the pattern where main breaks from concurrent PRs despite each passing independently.
The fix
Carp moves from the unquote loop into the whitespace loop beside Clojure. The test's doc comment previously said the split-out arm "still serves
UnknownandCarp" — #104 made that false, so it now records what actually happened and why Carp left the list.Verification
cargo build --workspace,cargo test --workspace,cargo test --test cli(3085 passed),cargo fmt --all --check,cargo clippy --all-targets --all-features -- -D warnings— all exit 0.