fix: name the word to quote when a path command name meets = - #442
Merged
Conversation
Two error paths from the literal-word stack answered with an internal token name instead of the fix. `./bin=1` reported "found './bin' expected 'NEWLINE', 'set', identifier, assignment, POSIX function, ...". The command parser hands an adjacent `=` to assignment parsing so `x=1` stays an assignment, but only an identifier can start an assignment lvalue. For a path name the deferral was to a parser that could never apply, so the glued-word diagnosis never ran and a generic alternative list stood in its place. The filter now fires only for an identifier name; `./bin=1`, `src/bin=1`, `2026/report=1`, `/usr/bin/x=1`, and `true=1` all reach the glued-word message again. The last three never reached it, on any release. Reporting the right message exposed the wrong span: it named `1`, not `./bin=1`. Two causes. A bare `=` was not a glue-candidate unit, so word/`=`/word never formed one run; and the run had to begin at or after the grammar's own error position, while `reject_glued_args` reports at the run's *last* fragment. An `=` between two adjacent words now joins the run, and a run qualifies when it reaches that position rather than starting after it. `p=~10-20` reported "found 'DASHNUM(10-20)'". The tilde-split suffix list carried every other word token but `DashNumWord`, so a dash-number path did not fuse. `p=~2024-01-02` parses like `p=~user` now. CHANGELOG entries for the four merged layers were in reverse dependency order; they read in the order the changes build. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Two error paths from the literal-word stack answered with an internal token name instead of the fix.
A command name that cannot start an assignment now reports glued words and names the word to quote. The command parser hands an adjacent
=to assignment parsing sox=1stays an assignment, but only an identifier can start an assignment lvalue; for a path name the deferral went to a parser that could never apply, so the glued-word diagnosis never ran. The filter now fires only for an identifier name.Reporting the right message exposed the wrong span: it named
1, not./bin=1. A bare=was not a glue-candidate unit, so word/=/word never formed one run, and a run had to begin at or after the grammar's error position while the rejection reports at the run's last fragment. An=between two adjacent words now joins the run, and a run qualifies when it reaches that position.Home-relative assignments accept a dash-number path.
DashNumWordwas the one word token missing from the tilde-split suffix list.Across a hundred probed inputs the only parse-result changes are those two; everything else differs in error text alone. The CHANGELOG entries for the four merged layers are reordered to read in the order the changes build.
Validation: 6,712 tests pass, clippy across all targets with warnings denied, rustdoc with warnings denied, kernel tests without default features. The new cases fail against the current main and pass here; the pre-existing cases in both suites pass either way.
Reviewed through kaibo, GLM-5.2 with DeepSeek V4 Flash investigation.
🤖 Generated with Claude Code