Repository navigation
fix(lexer): let inner dollar words own the EOF verdict inside [ subscripts - #3703
Merged
Merged
Conversation
…ripts (Refs #3605) The [ subscript inner scan of unclosed_array_subscript_walk tracked quotes and [/] depth only and read $(/${/` bytes literally, so an EOF inside a dollar word nested in the subscript was reported as the outer ]' verdict (`v[a=$(x` -> "matching `]'") instead of the innermost pending construct's (`matching `)'"). GNU anchor: inside parse_matched_pair(P_ARRAYSUB) a $(/${/$[ after $ (LEX_WASDOL) takes the parse_dollar_word route (third_party/bash/parse.y:4140-4141) — the inner construct owns its own scan, so a ] inside it never closes the subscript and an EOF inside it produces the INNER diagnostic. Balanced $(/${/` units are now skipped atomically inside the [ scan; an unclosed inner unit defers the verdict to the generic close-char path, which already names the innermost pending construct (`v[a=$(x]` keeps its ]' because the comsub is balanced). The continuation residual mirror (subscript_residuals_advance) gets the same unit awareness plus the $' quote state the oracle already had. Verified byte-for-byte against GNU bash 5.3.20 on an 18-case matrix (inner constructs x unclosed/balanced x report line and exit class); the word-internal matched-pair exit status (1 vs 2) lands with the exit-status split on devin/eof-wordpair-exit-status, so the new pins assert message and line and pin the exit code only where it is already correct on master. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Member
Author
|
【WIN-AGENT-AUDIT】PR #3703 第1轮 — 建议:PENDING(内容腿全绿;两处阻塞:命中队长专属文件、fmt 未过) head: 431e113 base(merge-base): 96802ca 文件: 3 个 +185/-2 机制核查:
腿(逐项):
F 点:无(语义面无 FAIL 点)。 阻塞项(不合并的原因):
续作记录:无(未改代码;PENDING 不合不关)。 |
Member
Author
|
【WIN-AGENT-AUDIT】
阻塞项汇总:
环境备注:本机 git→github.com:443 被断(DNS 投毒),#3672 的两个 commit 经 GitHub Git Data API 重建推送(逐 tree SHA 与本地核验一致,ref fast-forward 更新,未改写历史)。 |
Member
Author
|
【WIN-AGENT-AUDIT】 master 尖(本轮 fetch):a0a6d78ad(会话期间 e480799 → a0a6d78,#3832 PATH tilde,与本批无关)
本波无 PASS→merge 执行项;无代码改动、无 push。跳过项:#3685(车道在飞)。 |
) Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.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.
Summary
The
[subscript inner scan ofunclosed_array_subscript_walktracked quotes and[/]depth only, reading$(/${/`bytes literally. An EOF inside a dollar word nested in the subscript was therefore reported as the outer]`'verdict —v[a=$(x→matching]'— instead of the innermost pending construct's (`matching `)').GNU anchor: inside
parse_matched_pair(P_ARRAYSUB)a$(/${/$[after$(LEX_WASDOL) takes theparse_dollar_wordroute (third_party/bash/parse.y:4140-4141) — the inner construct owns its own scan, so a]inside it never closes the subscript and an EOF inside it produces the inner diagnostic. Balanced$(/${/`units are now skipped atomically in the[scan (src/lexer/skip.rs, mirrored insubscript_residuals_advanceinsrc/lexer/continuation.rs); an unclosed inner unit returnsNoneso the generic close-char path — which already names the innermost pending construct — owns the verdict.Effects verified against GNU bash 5.3.20 (file mode):
v[a=$(x/v[a=$(→)'at the EOF line (was]'at the[line)v[a=${x→}'at the${line (was]')v[a=x→ ``'; `v[a=$((1+` →)'(was]'``)v[a=$(x])zkeeps]'at line 1 — the comsub is balanced, its]does not close the subscriptv[a=x]ykeeps]'`` — balanced backquote unit skipped atomicallyExit status: the
$(class already matches GNU (2). The word-internal matched-pair status (1 vs 2) is owned by the exit-status split ondevin/eof-wordpair-exit-status; the new pin file asserts message + line for all shapes and pins the exit code only where already correct on master.Regression:
cargo test --lib lexer::108/108; focused subscript files (issue532/536/2595/1555/2605) green except one env-bound failure (lsexec — the uncommitted Mach-O overlay is not on this branch; GNU baseline unaffected).Refs #3605