Repository navigation
fix: 复合赋值的引号状态泄漏 (#733) - #792
Merged
Merged
Conversation
Contributor
|
欢迎!这是你的第一个 PR 🎉 请确认已跑过本地测试套件;CI 通过后维护者会 review。 |
This was referenced Nov 1, 2026
Closed
Closed
Closed
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.
Closes #733
Bug A:hoist_data_single_quotes 状态错乱
hoist_data_single_quotes不知道"已经被换成了 \u{E302} 哨兵,把"it's"里的单引号当成了定界符,导致引号状态错乱。修复
跟踪 \u{E302} 哨兵,正确维护 in_double 状态。
Bug B:单引号整词被错误展开
单引号包裹的整词(如
declare d1=('\')的'\')在剥引号后传is_quoted=true,丢失了"整个词是单引号字面量"的信息,导致\被当成变量展开。修复
单引号包裹整词直接返回 None,不认领——走普通路径保持字面量(GNU arrayfunc.c:581 parse_string_to_word_list + subst.c:11881:单引号整词是字面数据,引号抑制的是展开本身,不只是 field splitting)。
验证
3 个 issue case + 10 个边界 case 与 bash 一致;
declare d2=('*')的 glob case 本来就是对的;新回归测试tests/issue733_compound_quote_state_leak.rs7 个通过。