Repository navigation
Conversation
da8d79b to
efc319d
Compare
`Pexp_raw` (with a `Raw_expression` / `Raw_function` kind) and `Pstr_raw` hold the JavaScript source as written, so `Pconst_raw_source` is gone. PPXs still see the extensions, and v0 templates now keep their decoding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NP47qMfjMbjUTKZDsLthDo Signed-off-by: Christoph Knittel <ck@cca.io>
efc319d to
88b4db6
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8879 +/- ##
==========================================
- Coverage 81.01% 80.98% -0.03%
==========================================
Files 454 455 +1
Lines 63187 63390 +203
==========================================
+ Hits 51193 51339 +146
- Misses 11994 12051 +57
🚀 New features to boost your workflow:
|
|
@codex review |
Codex Review SummaryThis 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: 88b4db6f91
ℹ️ 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".
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-8879 |
A braced string payload is an ordinary string, with or without a PPX. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NP47qMfjMbjUTKZDsLthDo Signed-off-by: Christoph Knittel <ck@cca.io>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: caa10c51f3
ℹ️ 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".
A source that needs a template now escapes backquotes, ${ and backslashes,
and attributed templates stay templates through the v0 bridge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NP47qMfjMbjUTKZDsLthDo
Signed-off-by: Christoph Knittel <ck@cca.io>
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! 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". |
Part of #8624 ("extension-keyed language features → nodes"). Builds on #8875 (merged).
Summary
%raw,%ffiand%%rawget dedicated parsetree nodes instead of being extensions with a string payload, andPconst_raw_sourceis removed.%rawand%ffishare one node: both lower to the same raw JavaScript, and%ffionly adds the function check and an arity-based type. The kind keeps them apart for printing, typing and the v0 bridge.Ast_raw.js_sourcegives the JavaScript.", as the printer did before. Unlike before, the template escapes backquotes,${and backslashes where needed, so it parses back to the same JavaScript.name_locis the location of%raw/%ffi/%%raw, which cannot be derived from the node's location when attributes precede it.%raw/%ffi/%%rawextensions with the same v0 encoding, andAst_mapper_from0reads them back into the nodes..cmi,.cmtand AST magic numbers are bumped.Fix
Through a PPX, a template payload such as
%raw(`"a\${b}"`)lost its template marker in the v0 bridge. Its escapes were then not decoded, and locations in error messages shifted by one character. The node keeps the template, so compiling with and without a PPX now gives the same result.Braced string payloads such as
%raw({"\"a\""})were taken as JavaScript source through a PPX, and came back with a@res.bracesattribute instead of braces. They are now mapped like any other expression, so they are decoded as ordinary strings with and without a PPX.Tests
ast-mapping/RawExtensions.rescovers strings, templates with escapes, braced strings,%ffi, attributes, doc comments and%%raw.raw_output_test.rescompiles braced%rawand%%rawstrings.ounit_ast_mapper0_tests: raw sources printed as templates parse back to the same JavaScript, and attributed templates survive the v0 bridge.ounit_ast_mapper0_tests: raw nodes reach v0 as the extensions they are written as and come back unchanged, including a%%rawwith attributes.Compared with master (#8875), the formatter output and the v0 tree a PPX receives are identical for every
.res/.resifile in the repository. Compiled output and errors are identical for about 200%raw/%ffi/%%rawforms in many positions, including types, patterns and modules where they stay extensions. Through a PPX they differ only in the fixes above.🤖 Generated with Claude Code
https://claude.ai/code/session_01NP47qMfjMbjUTKZDsLthDo