Skip to content

regexp: consume n/u/e/s encoding modifiers (go-ruby-parser v0.1.8) - #587

Merged
tannevaled merged 1 commit into
mainfrom
wave18/parser
Sep 7, 2026
Merged

tannevaled merged 1 commit into
mainfrom
wave18/parser

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Unblocks the regexp encoding-modifier specs that two prior waves flagged as parser-gated.

Cross-repo fix. go-ruby-parser #23 (merged, tagged v0.1.8) now records the n/u/e/s regexp encoding modifiers in RegexpLit.Flags (they were deliberately dropped before). This PR bumps rbgo to v0.1.8 and consumes them in internal/vm/regexp.go compileRegexp: mapping per MRI re.c char_to_option — n=ASCII-8BIT (NOENCODING), u=UTF-8, e=EUC-JP, s=Windows-31J (u/e/s FIXEDENCODING); the last encoding letter wins; i/m/x/o are unaffected and sortIMX keeps the new letters out of the engine prefix.

Verified byte-for-byte vs MRI 4.0.5 (18/18 cases): /x/n.options==32, /x/u.options==16, /x/u.encoding==UTF-8, /x/e==EUC-JP, /x/s==Windows-31J, /x/n.encoding==US-ASCII, /x/u.fixed_encoding?==true, /a/un.options==32.

Ratchet: core/regexp 229→241 (+12), language/regexp 192→198 (+6) = +18.

Gates: go build ./..., full go test ./... (no pinned test broke), 100% coverage on compileRegexp + applyRegexpEncodingFlags, gofmt clean, wasip1 build. FLOOR untouched (bumped in the consolidated wave-18 floor PR).

🤖 Generated with Claude Code

go-ruby-parser v0.1.8 (#23) now records the encoding modifiers n/u/e/s in
RegexpLit.Flags alongside i/m/x/o. compileRegexp maps them onto the Regexp's
FIXEDENCODING/NOENCODING state and source encoding (MRI re.c char_to_option /
rb_reg_initialize): n=ASCII-8BIT (NOENCODING), u=UTF-8, e=EUC-JP,
s=Windows-31J (u/e/s FIXEDENCODING); last encoding letter wins. i/m/x/o are
unaffected and sortIMX still excludes the new letters from the engine prefix.

Verified byte-for-byte vs MRI 4.0.5: /x/n.options 32, /x/u.options 16,
/x/u.encoding UTF-8, /x/e EUC-JP, /x/s Windows-31J, /x/n.encoding US-ASCII,
/x/u.fixed_encoding? true, /a/un.options 32. Ratchet: core/regexp 229->241
(+12), language/regexp 192->198 (+6). Bumps go-ruby-parser 0.1.7 -> 0.1.8.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit f443021 into main Sep 7, 2026
7 checks passed
@tannevaled
tannevaled deleted the wave18/parser branch September 7, 2026 15:32
tannevaled added a commit that referenced this pull request Sep 7, 2026
…590)

Wave-18 merged three bibliography-first conformance PRs:
- #587 core/regexp: consume the n/u/e/s encoding modifiers now recorded by
  go-ruby-parser v0.1.8 (cross-repo #23) — core/regexp +12, language/regexp +6.
- #588 core/io: read/write/positioning/iteration surface (gets/each/seek symbol
  whence/closed-stream guards/putc/sync/binread) — core/io +48.
- #589 core/kernel: Integer/Float coercion messages, default Object#inspect with
  the object address + ivars, Object#<=> via #== with a Comparable#== recursion
  guard (fixing a stack overflow), at_exit no-block ArgumentError — core/kernel +16.

Measured total on merged main: 19651 passing. Local measure at TIMEOUT=25;
CI runs TIMEOUT=60 so its total is >= this floor.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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