fix(engine-javascript): resolve regex engine limitations and discrepa…#1244
Open
crazylogic03 wants to merge 7 commits intoshikijs:mainfrom
Open
fix(engine-javascript): resolve regex engine limitations and discrepa…#1244crazylogic03 wants to merge 7 commits intoshikijs:mainfrom
crazylogic03 wants to merge 7 commits intoshikijs:mainfrom
Conversation
…ncies - Implement pattern splitting for large SQL regexes to bypass V8 limits - Add capture group padding to match Oniguruma behavior - Enforce ES2018 target to fix `\b` emulation issues with `v` flag
✅ Deploy Preview for shiki-next ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for shiki-matsu ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1244 +/- ##
==========================================
+ Coverage 95.25% 95.41% +0.16%
==========================================
Files 92 92
Lines 8008 8186 +178
Branches 1704 1787 +83
==========================================
+ Hits 7628 7811 +183
+ Misses 374 369 -5
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
@antfu Please review the PR 🙂 and All Checks Have Been Passed |
Contributor
Author
|
@antfu all check have passed please have time to review and merge this PR🙂 |
Contributor
Author
|
@antfu Please Review This PR |
Member
|
Would you consider contributing to https://github.com/slevithan/oniguruma-to-es instead? |
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.
This PR addresses critical regressions and discrepancies in the engine-javascript package where it failed to match the behavior of the WASM engine, particularly for complex grammars like SQL.
What this PR solves:
Fixes SQL Grammar Failures: Resolves issues where large regex patterns (e.g., extensive keyword alternations) caused V8 regex engine limitations or incorrect matches.
Corrects Capture Group Indexing: Implements logic to correctly handle capture groups when patterns are split. Previously, splitting large patterns caused "Expected X groups, received Y" errors.
Fixes Regex Flag Incompatibility: Resolves a specific issue where the default v flag (ES2024) caused faulty emulation of word boundaries (\b) when combined with case-insensitivity ((?i)).