Skip to content

Conversation

Copilot AI review requested due to automatic review settings May 23, 2025 07:45
@graphite-app
Copy link
Contributor

graphite-app bot commented May 23, 2025

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.

@github-actions github-actions bot added A-parser Area - Parser C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels May 23, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors parser peeking logic by replacing direct lexer peeking (peek_at) with lookahead callbacks, mirroring the TypeScript parser approach.

  • Exposed next_token_is_open_brace to enable lookahead.
  • Swapped out peek_at for lookahead(Self::next_token_is_open_brace) in the static block check.
  • Introduced an inline lookahead closure for string‐constructor call detection.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
crates/oxc_parser/src/modifiers.rs Made next_token_is_open_brace pub(crate) for lookahead use.
crates/oxc_parser/src/js/class.rs Replaced peek_at calls with lookahead for two parsing cases.
Comments suppressed due to low confidence (1)

crates/oxc_parser/src/js/class.rs:202

  • Ensure there are unit tests covering the static block parsing path after switching to lookahead, to verify no behavior regression.
if self.at(Kind::Static) && self.lookahead(Self::next_token_is_open_brace) {

@codspeed-hq
Copy link

codspeed-hq bot commented May 23, 2025

CodSpeed Instrumentation Performance Report

Merging #11243 will not alter performance

Comparing r/remove-peek-class (4e12796) with main (3eb027b)

Summary

✅ 38 untouched benchmarks

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label May 23, 2025
Copy link
Member

Boshen commented May 23, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the r/remove-peek-class branch from 9388a6b to 4e12796 Compare May 23, 2025 07:52
@graphite-app graphite-app bot merged commit 4e12796 into main May 23, 2025
25 checks passed
@graphite-app graphite-app bot deleted the r/remove-peek-class branch May 23, 2025 07:59
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-parser Area - Parser C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants