-
-
Notifications
You must be signed in to change notification settings - Fork 376
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
feat(coverage): enable regexp in test262 #4242
base: regexpp
Are you sure you want to change the base?
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
CodSpeed Performance ReportMerging #4242 will degrade performances by 12.6%Comparing Summary
Benchmarks breakdown
|
This comment was marked as outdated.
This comment was marked as outdated.
Original regexp was invalid, it throws SyntaxError even in browser. ![image](https://github.com/user-attachments/assets/205729b2-a7f3-4cc1-bc63-7d84f87dc4d2) I need this change due to reduce CI errors in #4242 🥹
let span = self.start_span(); | ||
|
||
// split out pattern | ||
let (pattern_end, flags) = self.read_regex(); | ||
let pattern_start = self.cur_token().start + 1; // +1 to exclude `/` | ||
let pattern = &self.source_text[pattern_start as usize..pattern_end as usize]; | ||
if let Err(diagnostic) = PatternParser::new( |
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.
Reparsing each regex
eagerly in place sounds not reasonable, can we introduce another visit pass (enabled by a option) and reparse each regex then emit diagnostic at the end?
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.
Most downstream users of parser
may not care about whether the regex semantic is correct or not like formater, bundler.
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.
But actually, I'm also concerned about how to finish this PR.
With current code, oxc_parser
parses RegExp
and reports errors, but does not seem to hold the parsed results.
@Boshen What were your original plans?
To make the #4242 tests pass. (My `RegExp` parser tells me `/as)df/` is invalid syntax. 😂)
FYI:
|
Thanks for your explanation |
@leaysgur This enables all test262 regexp tests, feel free to decide when's the right time to integrate.
It seems like we need to add some pointing spans on the diagnostics.
It's somewhat slow to run
just c
, so I always usejust example parser
for local development.