Repository navigation
Return the parser's warnings instead of printing them - #9363
Conversation
Changelog💅 Polish
Semantic Diff1 commit · Full page ✏️ Return the parser's warnings instead of printing them0aef0e2 · cknitt + Claude · Nov 20, 2026, 22:07 UTC · edited The parser printed its one warning, for the deprecated (. ...) syntax, through the compiler's warning reporting when it finished. It now keeps its warnings as values of a new type, Res_warning.t, and returns them with the parse result. The compiler reports them as before, right after parsing: Syntax_driver.report_warnings turns them into Warnings.Deprecated, called by bsc, res_parser, the playground and Res_multi_printer. Editor analysis, rescript-tools and the snippets the compiler parses for error hints no longer print the warning. A unit test checks the returned warnings. |
✅ Compiler benchmarksAllocated wordsIn total: 636,548,865 → 636,549,839 (±0.00%). Generated projects: 629,013,942 → 629,016,287 (±0.00%). None of the 265 benchmarks changed by 0.1% or more. InstructionsIn total: 9,222,455,744 → 9,222,593,747 (±0.00%).
Output sizeIn total: 25,969,539 → 25,969,533 (±0.00%). None of the 13 benchmarks changed by 0.1% or more. Pull request 0aef0e2 compared with base 8103f0c in this run. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## parser-driver-to-common #9363 +/- ##
========================================================
Coverage 82.19% 82.19%
========================================================
Files 461 462 +1
Lines 65749 65761 +12
========================================================
+ Hits 54043 54055 +12
Misses 11706 11706
🚀 New features to boost your workflow:
|
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 645cb8ba17
ℹ️ 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 printed its one warning, for the deprecated (. ...) syntax, through the compiler's warning reporting when it finished. It now keeps its warnings as values of a new type, Res_warning.t, and returns them with the parse result. The compiler reports them as before, right after parsing: Syntax_driver.report_warnings turns them into Warnings.Deprecated, called by bsc, res_parser, the playground and Res_multi_printer. Editor analysis, rescript-tools and the snippets the compiler parses for error hints no longer print the warning. A unit test checks the returned warnings. 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>
645cb8b to
0aef0e2
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Stacked on #9362. The parser printed its one warning, for the deprecated
(. ...)syntax, through the compiler's warning reporting when it finished parsing. For a parser library, warnings should be values the caller decides about.Res_warning, has a warning kind,Deprecated_uncurried_dot, a record of kind and location, andmessage, which keeps the current text.Res_warning.tvalues, andRes_parser.finishno longer prints them.Res_driver's parse results have a newwarningsfield.Syntax_driver.report_warningsturns them intoWarnings.Deprecatedand reports them throughLocation.prerr_warning, as before. It is called right after parsing, before syntax errors are printed, so text, locations and order stay the same, by: the compiler'sparse_implementation/parse_interface,bsc -format,Res_multi_printer,res_parserand the playground.rescript-toolsand the snippets the compiler parses for error hints no longer print the warning. The editor shows warnings from the build. A changelog fragment notes this.The syntax test snapshots with the warning (for example
uncurriedLegacyDot.res.txt) are unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01QchYQ7itFLVLUmZ368okjH