Skip to content

Fix escaped hyphen regex class translation#4430

Closed
andrewtdiz wants to merge 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/regex-escaped-hyphen-class
Closed

Fix escaped hyphen regex class translation#4430
andrewtdiz wants to merge 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/regex-escaped-hyphen-class

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Summary

  • preserve escaped hyphen as a literal while translating JavaScript character classes to Rust regex syntax
  • add a Node parity fixture covering minimal escaped-hyphen classes and the marked table delimiter pattern

Validation

  • cargo fmt --all -- --check
  • CARGO_TARGET_DIR=/root/perry-worktrees/perry-node-webcrypto-cryptokey-property-exposure-20260604/target cargo check -q -p perry-runtime --lib
  • RUSTFLAGS='-Awarnings' cargo build --release -q -p perry-runtime
  • npm exec --yes --package=node@26 -- node --experimental-strip-types test-parity/node-suite/globals/regexp-character-class-escaped-hyphen.ts
  • PERRY_NO_AUTO_OPTIMIZE=1 PERRY_ALLOW_UNIMPLEMENTED=1 /root/perry-worktrees/perry-node-webcrypto-cryptokey-property-exposure-20260604/target/debug/perry run test-parity/node-suite/globals/regexp-character-class-escaped-hyphen.ts
  • diff -u /tmp/node_regex_escaped_hyphen.out /tmp/perry_regex_escaped_hyphen.out
  • git diff --check
  • ./scripts/check_file_size.sh

Closes #4425

@andrewtdiz
Copy link
Copy Markdown
Contributor Author

Closing this draft as duplicate coverage for #4425. PR #4429 was opened earlier with the same targeted escaped-hyphen translator fix, so keeping the active review surface there.

@andrewtdiz andrewtdiz closed this Jun 4, 2026
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.

regex: escaped hyphen \- as a literal in a character class is rejected ("invalid pattern") when flanked by other members

1 participant