Skip to content

fix(parser): preserve reparsed await tokens - #26619

Merged
graphite-app[bot] merged 1 commit into
mainfrom
codex/fix-unambiguous-await-tokens
Sep 16, 2026
Merged

graphite-app[bot] merged 1 commit into
mainfrom
codex/fix-unambiguous-await-tokens

Conversation

@camc314

@camc314 camc314 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

In unambiguous mode, await /x/u; export {}; is reparsed into an await expression with a regexp literal, but the returned tokens still describe division operators and identifiers.

Replace tokens in reparsed ranges while preserving surrounding tokens. Avoid appending overlapping ranges twice when one reparse consumes a later checkpoint, as in await\nawait /x/u; export {};. Add parser API comparisons with explicit module mode and a JS plugin regression covering token ranges through both token APIs.

The standalone lexer comparison now uses the parser's resolved script/module mode so both sides interpret these tokens in the same context.

Copilot AI lite review requested due to automatic review settings September 14, 2026 06:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-14T07:57:05.545176Z 3289423 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added A-linter Area - Linter (oxlint): rules, config, diagnostics, fixes. Add L-* labels for details A-parser Area - JS/TS parsing and syntax errors, oxc_parser A-cli Area - oxlint / oxfmt common CLI behavior: flags, ignore files, oxc_config L-js-plugins Linter > JS plugins (ESLint-compatible plugin API) labels Sep 14, 2026
@codspeed

codspeed Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 72 untouched benchmarks
⏩ 9 skipped benchmarks1


Comparing codex/fix-unambiguous-await-tokens (78fcdd0) with main (68ce610)2

Open in CodSpeed

Footnotes

  1. 9 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (0db906e) during the generation of this report, so 68ce610 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@camc314

camc314 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

cc @overlookmotel

@camc314
camc314 force-pushed the codex/fix-unambiguous-await-tokens branch from a2de08f to a0300a7 Compare September 14, 2026 06:52

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: efe7b82d1e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@camc314
camc314 force-pushed the codex/fix-unambiguous-await-tokens branch from efe7b82 to 3289423 Compare September 14, 2026 07:51
@camc314 camc314 changed the title fix(parser): preserve reparsed await tokens fix(parser): preserve reparsed await tokens Sep 14, 2026
@overlookmotel
overlookmotel force-pushed the codex/fix-unambiguous-await-tokens branch from 3289423 to 78fcdd0 Compare September 16, 2026 21:28

Copy link
Copy Markdown
Member

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 changes, fast-track this PR to the front of the merge queue

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.

@overlookmotel overlookmotel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Pushed a few trivial clean-up commits.

The code is quite hard to follow, but it looks correct.

"unambiguous" mode is a nightmare. I wish it wasn't our default!

@overlookmotel overlookmotel self-assigned this Sep 16, 2026
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Sep 16, 2026

overlookmotel commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Merge activity

In unambiguous mode, `await /x/u; export {};` is reparsed into an await expression with a regexp literal, but the returned tokens still describe division operators and identifiers.

Replace tokens in reparsed ranges while preserving surrounding tokens. Avoid appending overlapping ranges twice when one reparse consumes a later checkpoint, as in `await\nawait /x/u; export {};`. Add parser API comparisons with explicit module mode and a JS plugin regression covering token ranges through both token APIs.

The standalone lexer comparison now uses the parser's resolved script/module mode so both sides interpret these tokens in the same context.
@graphite-app
graphite-app Bot force-pushed the codex/fix-unambiguous-await-tokens branch from 78fcdd0 to 7811f0a Compare September 16, 2026 21:50
@graphite-app
graphite-app Bot merged commit 7811f0a into main Sep 16, 2026
34 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Sep 16, 2026
@graphite-app
graphite-app Bot deleted the codex/fix-unambiguous-await-tokens branch September 16, 2026 21:55
graphite-app Bot pushed a commit that referenced this pull request Sep 21, 2026
### 🚀 Features

- 1fac655 coverage: Support new TypeScript fixture layout (#26226) (camc314)

### 🐛 Bug Fixes

- cd7228f minifier: Add missing negation for boolean literal (#26847) (Armano)
- 32305e2 transformer: Skip enum reverse mappings for syntactic string initializers (#26724) (Dunqing)
- 7811f0a parser: Preserve reparsed `await` tokens (#26619) (camc314)
- 9220158 transformer: Skip recovered using loop patterns (#26722) (camc314)
- 3130405 parser: Recover await using object binding patterns (#26721) (camc314)
- 827fdbd parser: Reject invalid modifiers on import aliases (#26622) (camc314)

### ⚡ Performance

- 3f1e3aa minifier: Preallocate stmts vec size to avoid excesive reallocs (#26856) (Armano)
- bd3f69e semantic: Reuse identifier hashes in enum member lookups (#26773) (camc314)
- 5f72954 minifier: Reduce allocations when processing if statements (#26666) (Armano)
graphite-app Bot pushed a commit that referenced this pull request Sep 21, 2026
# Oxlint
### 🚀 Features

- 809090c oxlint,oxfmt: Find all `vite.config.*` variants (#26755) (leaysgur)
- a047b67 linter: Report JavaScript plugin rule timings (#26415) (Alexander Lichter)
- 2300898 linter/unicorn/no-unreadable-iife: Implement suggestion (#26658) (Mikhail Baev)

### 🐛 Bug Fixes

- 12cb547 linter/eslint/no-unused-vars: Report private namespace bindings (#26842) (camc314)
- 927bfa4 oxlint/lsp: Align nested config handling with `configPath` semantics (#26762) (leaysgur)
- e096dfd linter/esliny/no-unused-vars: Handle comments when removing imports (#26781) (camc314)
- 9d48bae linter/esliny/no-unused-vars: Preserve rest bindings when removing array elements (#26778) (camc314)
- 62a2bb2 linter/eslint/preserve-caught-error: Prevent conflicting fixes with prefer-optional-catch-binding (#26726) (camc314)
- 0d565bc linter/unicorn/consistent-function-scoping: Detect ancestor-only function captures (#26625) (camc314)
- 3c98cde linter/vitest/prefer-to-be-truthy: Suggest assertion rewrites (#26761) (camc314)
- 7811f0a parser: Preserve reparsed `await` tokens (#26619) (camc314)
- e15f103 linter/react: Add a few more missing properties to `no-unknown-property` (#26572) (Connor Shea)

### ⚡ Performance

- c6a00e6 linter/eslint/no-restricted-exports: Skip inactive configurations (#26772) (camc314)
- 0026008 linter/eslint/capitalized-comments: Avoid unnecessary case-conversion allocations (#26754) (camc314)
- 34482c9 linter/oxc/no-map-spread: Avoid collecting spread spans twice (#26718) (camc314)
- 2ce913e linter/eslint/no-inline-comments: Skip unnecessary JSX node scans (#26714) (camc314)
- b946951 linter/eslint/no-control-regex: Avoid temporary diagnostic allocations (#26713) (camc314)
- 8903402 linter/promise/no-multiple-resolved: Avoid collecting executor parameters (#26691) (camc314)
- 3aa4b25 linter/jsx-a11y/anchor-ambiguous-text: Avoid temporary word allocations (#26692) (camc314)
- 2e07b32 linter/react/jsx-handler-names: Avoid temporary prefix collections (#26688) (camc314)
- 2d3b7a6 linter/typescript/consistent-generic-constructors: Avoid intermediate comment strings (#26687) (camc314)
- 97beefb linter/typescript/triple-slash-reference: Avoid attribute parsing allocations (#26686) (camc314)
- 6b9452d linter/unicorn/prefer-export-from: Avoid temporary attribute vector (#26685) (camc314)
- 8759780 linter/eslint/no-useless-assignment: Short-circuit identical scopes (#26684) (camc314)

### 📚 Documentation

- 68baaa4 linter/typescript/await-thenable: Revert add missing lang for markdown doc comment (#26757) (camc314)
- aa7de00 lsp: Document that the `run` option only applies to push mode clients (#26670) (im10furry)
# Oxfmt
### 🚀 Features

- 809090c oxlint,oxfmt: Find all `vite.config.*` variants (#26755) (leaysgur)
- 4356dc2 formatter_markdown: Keep frontmatter verbatim (#26779) (leaysgur)
- 7717813 formatter_markdown: Implement markdown formatter (#26434) (leaysgur)
- 6c8a862 formatter: Glue `fbt` component and text (#26616) (leaysgur)

### 🐛 Bug Fixes

- 68ed6a2 formatter_markdown: Fix real-world missmatches (#26785) (leaysgur)
- 68ce610 formatter: Keep after-operator comments in place (#26725) (leaysgur)
- f91ad92 formatter: Let union place leading comments at `as|satisfies` (#26674) (leaysgur)
- ea164c0 formatter: Fix block comment with RHS assignment and typecast-ed arrow body (#26672) (leaysgur)
- 406ff1f formatter: Preserve redundant parens for `TSTypeAliasDeclaration` with suppress comment (#26671) (leaysgur)

### 📚 Documentation

- e012542 formatter_core: Add note for blanked front matter (#26786) (leaysgur)
- 11ff089 formatter_markdown: Follow updated DIVERGENCES policy (#26776) (leaysgur)
- 8fa3617 oxfmt: Unify DIVERGENCES reference and drop notes (#26750) (leaysgur)
- d8a716c formatter_css: Unify DIVERGENCES reference (#26749) (leaysgur)
- 095a97c formatter: Unify DIVERGENCES reference (#26748) (leaysgur)
- 97dc427 formatter_graphql: Unify DIVERGENCES reference (#26747) (leaysgur)
- 09ecfa7 formatter_yaml: Unify DIVERGENCES reference (#26746) (leaysgur)
- 0c16983 formatter_core: Clean up FORMATTER_POLICY (#26745) (leaysgur)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - oxlint / oxfmt common CLI behavior: flags, ignore files, oxc_config A-linter Area - Linter (oxlint): rules, config, diagnostics, fixes. Add L-* labels for details A-parser Area - JS/TS parsing and syntax errors, oxc_parser L-js-plugins Linter > JS plugins (ESLint-compatible plugin API)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants