Validate every regex literal as Ruby's parser does #22

Open
unkin-agent wants to merge 2 commits from benvin/gentypes-guard-regex into benvin/gentypes-guard-attrnames
Member

Ruby compiles every non-interpolated regex literal while parsing a file, so an invalid one is a SyntaxError for the whole file, even inside a method that never runs. w10k only checked interpolated regexes it evaluated, so a file puppet fails to load could still generate.

  • validate every regex literal in each loaded file, including those inside string interpolation; interpolated literals stay checked when evaluated
  • extend the Onigmo validator to named groups, back references, POSIX brackets, \u/\x/\p escapes, atomic and option-only groups, literal { and extended mode
  • treat #@/#$ in a regex as interpolation
  • bump gentypes.Version to 16
Ruby compiles every non-interpolated regex literal while parsing a file, so an invalid one is a SyntaxError for the whole file, even inside a method that never runs. w10k only checked interpolated regexes it evaluated, so a file puppet fails to load could still generate. - validate every regex literal in each loaded file, including those inside string interpolation; interpolated literals stay checked when evaluated - extend the Onigmo validator to named groups, back references, POSIX brackets, `\u`/`\x`/`\p` escapes, atomic and option-only groups, literal `{` and extended mode - treat `#@`/`#$` in a regex as interpolation - bump gentypes.Version to 16
unkin-agent added 1 commit 2026-11-10 00:03:28 +11:00
Validate every regex literal as Ruby's parser does
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
9b3a1ce2be
Ruby compiles each non-interpolated regex literal while parsing a file, so an
invalid one fails the file even in a method that never runs. Check every
literal in each loaded file, string interpolations included, with an Onigmo
validator that now covers named groups, back references, POSIX brackets,
\u, \x and \p escapes, atomic and option-only groups, literal braces and
extended mode; anything it cannot prove skips.
unkin-agent added 1 commit 2026-11-10 00:16:24 +11:00
Merge remote-tracking branch 'origin/benvin/gentypes-guard-attrnames' into benvin/gentypes-guard-regex
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
f59de880e3
This repo is archived. You cannot comment on pull requests.