Skip to content
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

Draft
wants to merge 15 commits into
base: regexpp
Choose a base branch
from
Draft

feat(coverage): enable regexp in test262 #4242

wants to merge 15 commits into from

Conversation

Boshen
Copy link
Member

@Boshen Boshen commented Jul 13, 2024

@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 use just example parser for local development.

@Boshen Boshen requested a review from leaysgur July 13, 2024 03:06
Copy link

graphite-app bot commented Jul 13, 2024

Your org has enabled the Graphite merge queue for merging into main

Add 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.

@github-actions github-actions bot added A-parser Area - Parser A-transformer Area - Transformer / Transpiler A-prettier Area - Prettier labels Jul 13, 2024
Copy link

codspeed-hq bot commented Jul 13, 2024

CodSpeed Performance Report

Merging #4242 will degrade performances by 12.6%

Comparing regexp-tests (8a2f7a1) with regexpp (b16c6f4)

Summary

❌ 4 regressions
✅ 25 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark regexpp regexp-tests Change
minifier[antd.js] 214.8 ms 227.8 ms -5.7%
parser[antd.js] 104.2 ms 119.3 ms -12.6%
parser[pdf.mjs] 17.1 ms 18.2 ms -5.97%
transformer[antd.js] 245.3 ms 260.4 ms -5.81%

@leaysgur

This comment was marked as outdated.

Boshen pushed a commit that referenced this pull request Jul 30, 2024
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(
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Collaborator

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?

Boshen pushed a commit that referenced this pull request Aug 6, 2024
To make the #4242 tests pass.

(My `RegExp` parser tells me `/as)df/` is invalid syntax. 😂)
@leaysgur
Copy link
Collaborator

leaysgur commented Aug 6, 2024

FYI:

  • The previous CodSpeed result was one where the entire source code(!) was passed to the regexp parser, not the regular expression part
  • I have not yet been started parser perf improvements

@IWANABETHATGUY
Copy link
Contributor

FYI:

  • The previous CodSpeed result was one where the entire source code(!) was passed to the regexp parser, not the regular expression part
  • I have not yet been started parser perf improvements

Thanks for your explanation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area - Parser A-prettier Area - Prettier A-transformer Area - Transformer / Transpiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants