Repository navigation
fix(parser): skip nested $() as a unit inside an open case body (Refs #3623) - #3626
caomengxuan666 wants to merge 1 commit into
Conversation
…3623) dollar_command_substitution does not nest depth on (/) while a case is open, so case $(ls) in scanned the inner comsub inline: ls completed as the case subject and the inner ) hit the case-close arm, truncating the outer substitution at '$(case $(ls'. GNU parse.y:4451 parse_comsub parses every $( as a fresh parse, so the inner comsub is opaque to the outer case machine. Skip a nested $(...) as a unit when case_depth > 0 (same shape as the double-quote nested-$ skip), leaving a non-empty word so the case subject still completes at the next boundary. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
【WIN-AGENT-AUDIT】PR #3626 第1轮 — 建议:FAIL 机制核查:
腿(逐项给数字与名字):
F 点(建议 FAIL):
未跑/VOID 的腿:
|
|
【WIN-AGENT-AUDIT】PR #3626 第2轮 — 建议:FAIL(维持 S8 裁定;建议以 #3627 为准关闭本 PR,待队长裁定) V 波收网复核:
|
superseded — master 已修,保留 FAIL 判词本 PR 的机制( GNU 5.3.20 证据(脚本文件,36 形):master 尖
不关闭本 PR(按 lane 规则:#3627 未合入则不关、不修,保留 FAIL 判词);如需清理请由主持人裁决。 |
|
superseded — 关闭(不合并) 与 #3627 同一裁定:#3623 的缺陷已由 master lane o3 本轮实测(WSL GNU bash 5.3.20 脚本文件 / master 尖
|
Closes #3623.
dollar_command_substitutiondoes not nestdepthon(/)while acaseis open, socase $(ls) inscanned the inner comsub inline:lscompleted as the case subject and the inner)hit the case-close arm, truncating the outer substitution at$(case $(ls(syntax error near unexpected token ')').GNU parse.y:4451
parse_comsubparses every$(as a fresh parse, so the inner comsub is opaque to the outer case machine. This change skips a nested$(...)as a unit whencase_depth > 0(same shape as the existing double-quote nested-$(skip), leaving a non-empty word so the case subject still completes at the next boundary.Verified byte-identical to GNU for the issue repro plus empty-esac and pattern-list variants; 4 new regression pins in tests/issue3623_case_subject_comsub_regressions.rs.