Repository navigation
Move the compiler's parser driver out of the parser library - #9362
Conversation
ChangelogNo changelog entry. Semantic Diff1 commit · Full page Move the compiler's parser driver out of the parser library0ecb8d7 · cknitt + Claude · Nov 20, 2026, 21:28 UTC The parser library printed syntax errors through the compiler's error reporting and read files through the build's file store. That part now lives in a new compiler module, Syntax_driver in compiler/common: the compiler's parse_implementation and parse_interface, Already_reported, the report printer and a parsing engine that reads through Ext_io. Res_multi_printer moves there too, and the res_parser CLI keeps its own print engine. The parser library keeps the parse results and a pure explain_in_source for the messages. Res_driver.make_parsing_engine takes the file reader, and Res_driver.parsing_engine reads from disk. |
✅ Compiler benchmarksAllocated wordsIn total: 636,535,496 → 636,545,318 (±0.00%). Generated projects: 629,007,679 → 629,006,949 (±0.00%). None of the 265 benchmarks changed by 0.1% or more. InstructionsIn total: 9,222,840,900 → 9,222,439,116 (±0.00%). None of the 33 benchmarks changed by 0.1% or more. Output sizeIn total: 25,969,547 → 25,969,539 (±0.00%). None of the 13 benchmarks changed by 0.1% or more. Pull request 0ecb8d7 compared with base 8e8c22d in this run. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## ast-compiler-only-helpers #9362 +/- ##
==========================================================
Coverage 82.19% 82.19%
==========================================================
Files 460 461 +1
Lines 65744 65749 +5
==========================================================
+ Hits 54036 54043 +7
+ Misses 11708 11706 -2
🚀 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. |
|
Codex Review: Didn't find any major issues. Breezy! 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". |
The parser library printed syntax errors through the compiler's error reporting and read files through the build's file store. That part now lives in a new compiler module, Syntax_driver in compiler/common: the compiler's parse_implementation and parse_interface, Already_reported, the report printer and a parsing engine that reads through Ext_io. Res_multi_printer moves there too, and the res_parser CLI keeps its own print engine. The parser library keeps the parse results and a pure explain_in_source for the messages. Res_driver.make_parsing_engine takes the file reader, and Res_driver.parsing_engine reads from disk. 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>
5c9eab7 to
0ecb8d7
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. 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 #9360. The parser library (
syntax) printed syntax errors through the compiler's error reporting and read files through the build's file store. This PR moves that compiler side intocompiler/common, so the parser library only parses.Syntax_driver, holds the compiler's entry pointsparse_implementationandparse_interface,Already_reported, the report printerprint_report, and a parsing engine that reads throughExt_io(the build's file store).Res_multi_printermoves tocompiler/commonas well.Res_diagnostics.print_reportbecomesSyntax_driver.print_report. The messages, with their hints for[|and|>, stay in the parser as a pureRes_diagnostics.explain_in_source.Res_driver.make_parsing_engine ~load_filebuilds a parsing engine with a given file reader.Res_driver.parsing_engine, used by editor analysis andrescript-tools, reads from disk. Itsstring_of_diagnosticsfield is gone; the only user was the syntax tests.res_parserCLI keeps its own default print engine, which writes to stdout.rescript-toolsand theres_parserCLI now depend oncommon.Error output does not change: the syntax, super-errors and analysis snapshots are unchanged.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QchYQ7itFLVLUmZ368okjH