Skip to content

Use the standard library and Location in the parser instead of ext - #9364

Merged
cknitt merged 1 commit into
parser-warnings-as-valuesfrom
parser-off-ext
Nov 21, 2026
Merged

cknitt merged 1 commit into
parser-warnings-as-valuesfrom
parser-off-ext

Conversation

@cknitt

@cknitt cknitt commented Nov 20, 2026

Copy link
Copy Markdown
Member

Stacked on #9363. The parser library used a few ext helpers directly. This PR replaces them, so the parser reaches ext only through Location, which a later step splits.

  • Ext_list.map, filter_map and fold_left become List.map, List.filter_map and List.fold_left. Both visit elements left to right, so nothing changes. Three lambdas get a type annotation, since the lambda now comes before the list.
  • The scanner has its own copies of Ext_ident.is_uident and Ext_ident.unwrap_uppercase_exotic, two small checks for quoted identifiers like \"Name". Ext_ident.is_uident had no other user and is removed; unwrap_uppercase_exotic stays, the code generator and gentype use it.
  • Warnings.loc type annotations become Location.t, which is the same type.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QchYQ7itFLVLUmZ368okjH

@cknitt
cknitt added this pull request to stack #9361 November 20, 2026 22:17
@cknitt cknitt added the changelog:skip No release notes needed label Nov 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Changelog

No changelog entry.

Semantic Diff

1 commit · Full page

Use the standard library and Location in the parser instead of ext

20e017c · cknitt + Claude · Nov 20, 2026, 22:14 UTC

The parser library used a few ext helpers directly: Ext_list.map, filter_map and fold_left, which are List functions, two small identifier checks from Ext_ident, and Warnings.loc as a type annotation. It now uses List, its own copies of the two checks in Res_scanner, and Location.t, which is the same type. The parser reaches ext only through Location now. Ext_ident.is_uident had no other user and is removed.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

✅ Compiler benchmarks

Allocated words

In total: 636,553,281 → 636,553,614 (±0.00%).

Generated projects: 629,021,630 → 629,021,532 (±0.00%).

None of the 265 benchmarks changed by 0.1% or more.

Instructions

In total: 9,222,593,576 → 9,223,228,868 (+0.01%).

Benchmark Base Head Change
packages/@rescript/runtime/Stdlib_Math.resi 21,434,583 21,457,255 +0.11%
packages/@rescript/runtime/Stdlib_Temporal_PlainDate.res 24,217,514 24,242,942 +0.10%

Output size

In total: 25,969,533 → 25,969,532 (±0.00%).

None of the 13 benchmarks changed by 0.1% or more.

Pull request 20e017c compared with base 770e3dd in this run.

@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.20%. Comparing base (0aef0e2) to head (20e017c).

Additional details and impacted files
@@                    Coverage Diff                     @@
##           parser-warnings-as-values    #9364   +/-   ##
==========================================================
  Coverage                      82.19%   82.20%           
==========================================================
  Files                            462      462           
  Lines                          65761    65763    +2     
==========================================================
+ Hits                           54055    54058    +3     
+ Misses                         11706    11705    -1     
Files with missing lines Coverage Δ
compiler/ext/ext_ident.ml 80.70% <ø> (-0.26%) ⬇️
compiler/syntax/src/res_comments_table.ml 91.30% <100.00%> (ø)
compiler/syntax/src/res_core.ml 92.07% <100.00%> (ø)
compiler/syntax/src/res_parsetree_viewer.ml 94.61% <ø> (ø)
compiler/syntax/src/res_printer.ml 95.52% <100.00%> (ø)
compiler/syntax/src/res_scanner.ml 91.80% <100.00%> (+0.11%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new

pkg-pr-new Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@9364

@rescript/belt

npm i https://pkg.pr.new/@rescript/belt@9364

@rescript/darwin-arm64

npm i https://pkg.pr.new/@rescript/darwin-arm64@9364

@rescript/linux-arm64

npm i https://pkg.pr.new/@rescript/linux-arm64@9364

@rescript/linux-x64

npm i https://pkg.pr.new/@rescript/linux-x64@9364

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@9364

@rescript/win32-x64

npm i https://pkg.pr.new/@rescript/win32-x64@9364

commit: 20e017c

@cknitt

cknitt commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T07:54:54.888385Z 20e017c Manual request
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 853a66ec50

ℹ️ 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".

The parser library used a few ext helpers directly: Ext_list.map,
filter_map and fold_left, which are List functions, two small identifier
checks from Ext_ident, and Warnings.loc as a type annotation. It now uses
List, its own copies of the two checks in Res_scanner, and Location.t,
which is the same type. The parser reaches ext only through Location now.
Ext_ident.is_uident had no other user and is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QchYQ7itFLVLUmZ368okjH
Signed-off-by: Christoph Knittel <ck@cca.io>
@cknitt

cknitt commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 20e017c787

ℹ️ 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".

@cknitt
cknitt marked this pull request as ready for review November 21, 2026 07:56
@cknitt
cknitt merged commit caa6dd2 into master Nov 21, 2026
24 of 38 checks passed
@cknitt
cknitt deleted the parser-off-ext branch November 21, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:skip No release notes needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants