Semantic Diff

#8879 Represent %raw, %ffi and %%raw with parsetree nodes

3 commits, rendered from their records.

Summary

RangeCommitsChangelogAreasJS output changesFormatsFailed checks
735a485fae1a3dc04b016bbc23cc62f72a226051..pr-88793? ×30none7

Files changed by more than one commit

changes/raw-template-ppx.fix.md88b4db6f9, caa10c51f
compiler/ml/ast_mapper_from0.ml88b4db6f9, caa10c51f, 36f11f847
compiler/ml/ast_payload.ml88b4db6f9, caa10c51f
compiler/ml/ast_raw.ml88b4db6f9, 36f11f847
tests/ounit_tests/ounit_ast_mapper0_tests.ml88b4db6f9, 36f11f847
tests/syntax_tests/data/ast-mapping/RawExtensions.res88b4db6f9, caa10c51f
tests/syntax_tests/data/ast-mapping/expected/RawExtensions.res.txt88b4db6f9, caa10c51f

735a485fae1a3dc04b016bbc23cc62f72a226051..pr-8879

88b4db6f9 · Christoph Knittel · Oct 16, 2026

Represent %raw, %ffi and %%raw with parsetree nodes

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.

36 files · +572 −187 · reanalyze 1 · analysis 4 · changelog 2 · codegen 1 · compiler 1 · frontend 3 · gentype 1 · typechecker 15 · syntax 5 · tests 3
Manalysis/reanalyze/src/annotation.ml+2−1
Manalysis/src/completion_front_end.ml+3−2
Manalysis/src/document_symbol.ml+1−2
Manalysis/src/dump_ast.ml+0−1
Manalysis/src/utils.ml+1−0
Achanges/raw-extension-nodes.internal.md+1−0
Achanges/raw-template-ppx.fix.md+1−0
Mcompiler/core/js_implementation.ml+2−1
Mcompiler/ext/config.ml+4−4
Mcompiler/frontend/ast_exp_handle_external.ml+79−78
Mcompiler/frontend/ast_exp_handle_external.mli+11−0
Mcompiler/frontend/bs_builtin_ppx.ml+6−1
Mcompiler/gentype/annotation.ml+2−1
Mcompiler/ml/ast_helper.ml+4−0
Mcompiler/ml/ast_helper.mli+9−0
Mcompiler/ml/ast_iterator.ml+7−0
Mcompiler/ml/ast_mapper.ml+14−0
Mcompiler/ml/ast_mapper_from0.ml+45−3
Mcompiler/ml/ast_mapper_to0.ml+28−1
Mcompiler/ml/ast_payload.ml+13−4
Acompiler/ml/ast_raw.ml+74−0
Acompiler/ml/ast_raw.mli+30−0
Mcompiler/ml/depend.ml+2−1
Mcompiler/ml/parsetree.ml+19−6
Mcompiler/ml/pprintast.ml+8−2
Mcompiler/ml/printast.ml+16−1
Mcompiler/ml/typecore.ml+8−3
Mcompiler/ml/typemod.ml+3−0
Mcompiler/syntax/src/res_comments_table.ml+10−0
Mcompiler/syntax/src/res_core.ml+15−37
Mcompiler/syntax/src/res_parens.ml+8−7
Mcompiler/syntax/src/res_parsetree_viewer.ml+0−2
Mcompiler/syntax/src/res_printer.ml+15−17
Mtests/ounit_tests/ounit_ast_mapper0_tests.ml+93−12
Atests/syntax_tests/data/ast-mapping/RawExtensions.res+19−0
Atests/syntax_tests/data/ast-mapping/expected/RawExtensions.res.txt+19−0
with Claude Opus 5.5
caa10c51f · Christoph Knittel · Oct 16, 2026

Decode braced %raw strings as before

A braced string payload is an ordinary string, with or without a PPX.

7 files · +28 −3 · changelog 1 · typechecker 2 · tests 4
Mchanges/raw-template-ppx.fix.md+1−1
Mcompiler/ml/ast_mapper_from0.ml+5−1
Mcompiler/ml/ast_payload.ml+9−0
Mtests/syntax_tests/data/ast-mapping/RawExtensions.res+1−0
Mtests/syntax_tests/data/ast-mapping/expected/RawExtensions.res.txt+2−1
Mtests/tests/src/raw_output_test.mjs+6−0
Mtests/tests/src/raw_output_test.res+4−0
with Claude Opus 5.5
36f11f847 · Christoph Knittel · Oct 16, 2026

Escape raw sources printed as templates

A source that needs a template now escapes backquotes, ${ and backslashes, and attributed templates stay templates through the v0 bridge.

5 files · +107 −4 · typechecker 4 · tests 1
Mcompiler/ml/ast_mapper_from0.ml+4−3
Mcompiler/ml/ast_raw.ml+9−1
Mcompiler/ml/string_literal.ml+23−0
Mcompiler/ml/string_literal.mli+4−0
Mtests/ounit_tests/ounit_ast_mapper0_tests.ml+67−0
with Claude Opus 5.5