Repository navigation
fix(all): accept RegexOptions.NonBacktracking - #5178
Merged
Merged
Conversation
Contributor
Python Type Checking Results (Pyright)
Excluded files with errors (4 files)These files have known type errors and are excluded from CI. Remove from
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The narrow validation changes preserve existing engine behavior, add focused regression coverage, and have no identified blocking issues.
No open issues 🎉
What changed in this PR
This PR accepts and ignores RegexOptions.NonBacktracking across Fable targets, avoiding reliance on V8’s experimental linear-regex flag.
Changes:
- Allow
NonBacktrackingin JavaScript/TypeScript, Rust, and Dart runtime option validation without changing engine behavior. - Add regression tests across five targets covering case-insensitive construction, static matching, and replacement.
| File | Description |
|---|---|
tests/Rust/tests/src/RegexTests.fs |
Test NonBacktracking acceptance on Rust. |
tests/Python/TestRegex.fs |
Test NonBacktracking acceptance on Python. |
tests/Js/Main/RegexTests.fs |
Test NonBacktracking acceptance on JavaScript. |
tests/Dart/src/RegexTests.fs |
Test NonBacktracking acceptance on Dart. |
tests/Beam/RegexTests.fs |
Test NonBacktracking acceptance on BEAM. |
src/fable-library-ts/RegExp.ts |
Accept the option and update the validation message. |
src/fable-library-rust/src/RegExp.rs |
Accept the option without changing regex configuration. |
src/fable-library-dart/RegExp.dart |
Accept the option and update the validation message. |
Review effort: Balanced
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.
RegexOptions.NonBacktrackingis now accepted and ignored, likeCompiled: it only changes performance, not match results, and V8's linearlflag is still experimental and rejects theianduflags that .NET allows with it, so mapping to it would throw on every stock runtime.Supersedes #4104.