Skip to content

Refs #2759, #2819 - #3123

Merged
caomengxuan666 merged 6 commits into
masterfrom
fix/E6-wave1
Nov 9, 2026
Merged

caomengxuan666 merged 6 commits into
masterfrom
fix/E6-wave1

Conversation

@caomengxuan666

@caomengxuan666 caomengxuan666 commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

概要

180 单令第一波 · 组 E6(词分裂族两单):

本 PR 删除了什么

  • 删除了段装配里「双引号段只能整段留在字面 run 中」的旧路径:普通双引号段不再进未引字面 run,而是成为独立的 quoted 字面段(段模型不变,删除的是边界信息的丢失点)。
  • 未删除任何 API/函数;[bug] C locale 下多字节 IFS 字符按整字符拆分(GNU 按字节拆分) #2819 为新增字节域分裂路径 + read 值级变换,非多字节 locale 之外的行为逐字节不变。

验证(返工后,新头 9e229cf)

REWORKED — captain re-verification pending

Refs #2759
Refs #2819

… junctions (Refs #2759)

The dollar_at segment assembly joined a quoted prefix/suffix onto an
unquoted ${arr[@]} splice and split the joined string, splitting
inside the quoted part (GNU subst.c:11229 expand_word_internal tracks
quoting per character; subst.c:12273+ word splitting skips quoted
separators). New pin file covers the filed shapes plus controls;
also un-ignores the #2706-residual pin
quoted_result_protection_at_array_junction, whose expectations were
oracle-verified when filed.
)

GNU subst.c string_extract_verbatim decides separator membership in
the current locale: with MB_CUR_MAX == 1 (C/POSIX) membership is the
per-byte ifs_cmap built by setifs, so a multibyte IFS character
separates on each of its bytes; only a multibyte (UTF-8) locale
matches whole characters via wcschr. Pins cover read (scalar and -a),
ordinary word splitting, a three-byte IFS char, mixed byte+whitespace
IFS, and the UTF-8-locale control.
…ed ${arr[@]} junctions (Refs #2759)

The dollar_at segmenter left a plain double-quoted span (and any
$"..." span) inside the surrounding unquoted literal run, so the run
was cooked and expanded as unquoted text and the junction field split
landed inside the quoted part — GNU expand_word_internal
(subst.c:11229) tracks the quoting of every character and word
splitting skips quoted separators. The segmenter now emits such a
span as a quoted literal segment — the same Literal{quoted: true}
carrier the quoted-body segmenter already used for in-body pieces —
flushing the pending run first; the segment expander IFS-protects a
quoted literal's whole expansion result. $"..." goes through the
same word-list attempts ("$@", "${name[@]}", embedded-$@ bodies)
as a plain quoted span; $$"..." stays the PID expansion plus a
plain span. Spans the literal pushers decline (backtick/backslash
content) keep the historic in-run path byte-for-byte.
…#2819)

GNU subst.c string_extract_verbatim (subst.c:1148) decides separator
membership in the current locale: whole characters via wcschr only
when the locale is multibyte; with MB_CUR_MAX == 1 membership is the
per-byte ifs_cmap setifs builds, so a multibyte IFS character
separates on each of its bytes. field_split_values_with_ifs now
routes non-multibyte-locale splits (past the locale-invariant
unset/empty/default-whitespace branches) to a byte-domain twin that
decodes value and IFS to bytes with glue provenance, tests membership
per byte, mirrors the whitespace/mixed/non-whitespace field shapes,
and re-encodes fields to storage text. read follows through
read_split.rs: the scalar and non-raw -a value paths run the existing
logical-unit walk on a byte-domain rewrite of line and IFS (every
byte >= 0x80 becomes a raw-byte marker pair, so one logical unit is
one byte) and normalize the produced values back. The raw -a path
slices the caller's line by ranges and cannot represent mid-char
byte boundaries; it is filed as a follow-up gated on PR #2968, whose
live file table owns read_helpers.rs.
read_split.rs byte_domain_text widens *byte only under the
if *byte < 0x80 guard directly above (>= 0x80 bytes route to
encode_raw_byte_marker), so the widened byte is ASCII by
construction. Record the review in the hygiene allowlist, same
shape as the arithmetic/mod.rs guard-above precedent. No behavior
change; check-utf8-boundary-hygiene.sh now clean on this tree.
@caomengxuan666
caomengxuan666 marked this pull request as ready for review November 9, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant