Repository navigation
fix(parser,script_driver): fix master CI regressions from #3755 and #3701 - #3897
Merged
Merged
Conversation
…3701 1) Update keeps_comsub_case_subject empty-case expectation to Some("case $(ls) in esac") matching #3843 keeps_empty_case_esac_shape. 2) Restore exit status 2 for unmatched-delimiter EOF diagnostics in script_driver.rs (verified against GNU bash 5.3.20 in WSL: all word-internal pairs and -c/-n/file modes exit 2), keeping #3701 ANSI-C $'...' comsub walker fixes. 3) Restore status 2 assertions in consumer_tests.rs, issue1184_f6_backquote_eof_regressions.rs, and issue3605_eof_exit_status_word_pairs.rs.
This was referenced Nov 18, 2026
Closed
caomengxuan666
added a commit
that referenced
this pull request
Nov 18, 2026
…t exits 1, not 2 (Refs #3899, Refs #3900) fix(script_driver, lexer): EOF consumed by a compound array assignment exits 1, not 2 (Refs #3899, Refs #3900) #3897 changed the EOF route's arms to return 2 unconditionally. GNU does not: EOF consumed inside parse_compound_assignment's token loop sets EXECUTION_FAILURE (parse.y:7151-7152 diagnostic at the `name=(` line, :7167-7169 set status 1); the `error yacc_EOF` production forces 2 only on a still-zero status (parse.y:484-493), and live errexit forces 2 (error.c:324-327). The three arms (generic close-char, `$[` hunt, extglob) now consult the delimiter stack's array_list bit: status 1 when a compound assignment is open (2 under live errexit), else 2. Captain correction in the same PR (commit 2fc6dad, continuation.rs, captain-exclusive file): the close-char scan's top-level `(` arm classified any command-position `(` with a non-empty pending word as an array list, so `!(` (extglob/negation, pending word `!`) carried a false-positive array_list bit and flipped the issue3229 case-position extglob cell 2 -> 1 on the first head. array_list now requires a genuine `name=`/`name+=` word; other command-position words open a subshell frame. Applied in lockstep to the oracle scan and its checkpointable mirror. GNU probes: `case ab in / !(ab` -> rc 2 line 3; `v=(a +(x` -> 1; `echo +(x` -> 2. Verification (captain-adjudicated, REPORT ~/workspace/fix-eof-split/REPORT.md): - Head census (2fc6dad) total 81 (era band 79-88, better than tip 85): compat_issue78 green (CLI 7/7), issue551-c6 green, issue3229 stem green (10/10 on the server tree). New cells vs the old tip are census jitter on faces this diff cannot reach (issue2333 carrier family; issue3640 x2, already proven jitter by server isolation 7/7 on both trees; issue2340 wait-retention and issue2972 declare-listing, both green on the two immediately preceding heads and unreachable from EOF routing). - Goldens exactly the 2 baseline names. CLI's only fail is the documented coproc flake; the compat_issue78 CLI cell is green. - Server legs on the fixed tree: issue3229 10/10, compat_issue78 7/7, issue551 9/9, 40-shape oracle matrix byte-identical to the lane's fixed matrix, RUSTFLAGS="-D warnings" rc=0, rustfmt clean. - Merged without update-branch under the zero-intersection exception: base(bb27eb2)...tip(cc80b2d) touched only trap_exec.rs + 2 test files; this PR touches only script_driver.rs + continuation.rs. 本 PR 删除了什么: - 未删除任何产品代码、测试用例或钉。本 PR 只改 EOF 状态分流(script_driver.rs 三臂)与 close-char 扫描的 `(` 分类(continuation.rs 双臂);回归钉 tests/issue3229… 的既有断言保持 GNU 真值不变。 UNVERIFIED-BY-CAPTAIN — captain review: PASS. Merge by captain; #3899 and #3900 to be hand-closed by the captain after merge (Refs-only body, no auto-close). Residuals: #3904 (A13, PR #3908 in flight, rc assertions need this merge + rebase) and #3905 (A14, captain's nested-arm fix in continuation.rs, next).
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.
Fixes two master CI regressions introduced by #3755 and #3701:
keeps_comsub_case_subject(src/parser/command_substitution.rs):operator values: dequote stored CTLNUL + quoted-null retention oracle for @-lists #3755 added
keeps_comsub_case_subjectassertingextract("$(case $(ls) in esac)") == None(from before fix(executor): keep a$(body parse error fatal to the enclosing command (Refs #3756) #3843), while fix(executor): keep a$(body parse error fatal to the enclosing command (Refs #3756) #3843 had already updatedkeeps_empty_case_esac_shapetoSome("case x in esac"). Updatedkeeps_comsub_case_subjecttoSome("case $(ls) in esac").Unmatched-delimiter EOF exit status (
src/script_driver.rs+ tests):fix(comsub,parser): honor ANSI-C $'...' in $( walkers; split EOF exit status by construct #3701 changed word-internal matched-pair EOF diagnostics to exit
1, breakingcli_tests(malformed_parameter_expansions_return_status_two,unterminated_complete_command_strings_are_syntax_errors,cli_noexec_reports_unclosed_parameter_expansion,malformed_script_preserves_valid_prefix_before_status_two).Verified against GNU bash 5.3.20 in WSL: all of these (
echo ${x,echo "hi,-nnoexec,malformed_parameter_prefix.sh, and all 9 cases inissue3605_eof_exit_status_word_pairs.rs) exit2, not1.Restored exit status
2insrc/script_driver.rs(preserving fix(comsub,parser): honor ANSI-C $'...' in $( walkers; split EOF exit status by construct #3701 ANSI-C$'...'comsub walker fixes) and updatedconsumer_tests.rs,issue1184_f6_backquote_eof_regressions.rs, andissue3605_eof_exit_status_word_pairs.rsback to2.