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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fall back to CPU for unsupported regular expression edge cases with end of line/string anchors and newlines #5610
Fall back to CPU for unsupported regular expression edge cases with end of line/string anchors and newlines #5610
Changes from 2 commits
79883d4
1e6f126
43011cd
46471ef
224bfb2
74dd695
d98ff09
969a045
3a10384
f9ec1fb
d856a15
4d4d250
a87fb5d
78be837
df337b0
0e128f3
2e9f4e0
ef9fc5d
c6c010d
4aa0be8
04b2619
53330ef
a641fad
a364dba
8ea6c4b
d9a414f
12607b7
2fd9251
7a81dba
7cc007a
33cf006
d83ac04
ef22adc
9765ab8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
replacement
andprevious
is never used here, just passed on torewrite
. It may be more descriptive to remove these, rename this method tocheckUnsupported
(take the code out of the closure), and then call this andrewrite
insidetranspile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing we need to do (probably not in this PR) is to not check inside character classes to fix false positives such as
0*[D$3]
. Same thing with the begin anchorThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another case would be something like
\na$
will work but(\na)$
will not be supported. We should only be checking the node closest to the$
in groupsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #5659 to track this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: there is an edge case here that can prevent this from being a newline, and that being a negated character class that includes all new line characters. I see no need to handle this at the moment, but should be noted in case this potentially comes up in some testing scenarios.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NVnavkumar handled the
$\r
case in #5289, which transpiles to\r(?:[\n\u0085\u2028\u2029])?$
, and similarly for\u0085
,\u2028
,\u2029
. The other two don't have line terminators so I don't think there is a problem