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

fix(parser): fix SequenceExpression span #9035

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Feb 11, 2025

There's a very minor difference in span when SequenceExpression has empty spaces right after ( or before ).

For example, the following code has a different span/range depending on parsers:

( 1, 2 )
  ^^^^    (acorn, swc, babel)
 ^^^^^^   (oxc, tsc)

Just for acorn estree conformance sake, I changed a span to match acorn, but I'm not sure if there's any real value in choosing one over another.

@github-actions github-actions bot added the A-parser Area - Parser label Feb 11, 2025
Copy link
Contributor Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added the C-bug Category - Bug label Feb 11, 2025
Copy link

codspeed-hq bot commented Feb 11, 2025

CodSpeed Performance Report

Merging #9035 will not alter performance

Comparing 02-11-fix_parser_fix_sequenceexpression_span (567bc2c) with main (ad93ece)

Summary

✅ 33 untouched benchmarks

@hi-ogawa hi-ogawa marked this pull request as ready for review February 11, 2025 06:14
@Boshen Boshen self-assigned this Feb 11, 2025
@Boshen Boshen force-pushed the 02-11-fix_parser_fix_sequenceexpression_span branch from eb51ba3 to 5ced24d Compare February 11, 2025 06:59
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Feb 11, 2025
Copy link
Member

Boshen commented Feb 11, 2025

Merge activity

  • Feb 11, 2:08 AM EST: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Feb 11, 2:55 AM EST: A user added this pull request to the Graphite merge queue.
  • Feb 11, 2:58 AM EST: A user merged this pull request with the Graphite merge queue.

@Boshen Boshen force-pushed the 02-11-fix_parser_fix_sequenceexpression_span branch from 29ef781 to bba20f2 Compare February 11, 2025 07:46
There's a very minor difference in span when `SequenceExpression` has empty spaces right after `(` or before `)`.

For example,  the following code has a different span/range depending on parsers:

```js
( 1, 2 )
  ^^^^    (acorn, swc, babel)
 ^^^^^^   (oxc, tsc)
```

- oxc https://ast.sxzz.dev/#eNpNijEKgDAQBL9ybKUQBC19gC+wvCbECErMBaOiiH/3Cgu7md25EdBitofNbp3SBoOkg5xOySkVVBtqqFQV1ZsjESPLvjrfX8kzWvVFhj0om//dTcFHu3zJKFJtmcHxwfMCI14kXg==
- acorn https://ast.sxzz.dev/#eNotijEOwjAMRa8SeQIpC4w9BQNiymIZD0WpHdlJJVT17hi12/vv/Q0qTPDBFZ1sbh0ytBBIahJMwZd0y+merjE15lYkpQJMC77YfFYpMIWo2Nl7gXx012HEz2/jIy/6HjX4zM3Y2VZ+oLH4/9JtcJEd9h+w8S5G

Just for acorn estree conformance sake, I changed a span to match acorn, but I'm not sure if there's any real value in choosing one over another.
@graphite-app graphite-app bot force-pushed the 02-11-fix_parser_fix_sequenceexpression_span branch from bba20f2 to 567bc2c Compare February 11, 2025 07:53
@graphite-app graphite-app bot merged commit 567bc2c into main Feb 11, 2025
26 checks passed
@graphite-app graphite-app bot deleted the 02-11-fix_parser_fix_sequenceexpression_span branch February 11, 2025 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue A-parser Area - Parser C-bug Category - Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants