Skip to content

Conversation

@Dreian
Copy link

@Dreian Dreian commented Oct 10, 2025

Adds support for formatting runtime quotations and splices to ocamlformat.

The appropriate changes are added to the lexing, parsing, and formatting.

At the level of individual files, runtime metaprogramming can be enabled or disabled using a syntax directive: #syntax quotations [on|off]. This requires that we add such directives as a construct that does not lead to an error in the lexer; in fact, it has to get propagated through the parser and the formatter. These lexer directives are represented using the new lexer_directive type.

@Dreian Dreian marked this pull request as draft October 10, 2025 14:04
@Dreian Dreian force-pushed the runtime-metaprogramming branch 3 times, most recently from 535f727 to 3acbc08 Compare October 14, 2025 17:11
@Dreian Dreian marked this pull request as ready for review October 14, 2025 18:10
@Dreian Dreian force-pushed the runtime-metaprogramming branch from 0f0176b to 98072f9 Compare November 11, 2025 12:35
@Dreian Dreian force-pushed the runtime-metaprogramming branch from c165665 to 6ae29b6 Compare November 13, 2025 12:18
Copy link

@ccasin ccasin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more nitpicks below, but eagerly approving - thanks!

@Dreian Dreian merged commit 83ad63a into oxcaml:jane Nov 26, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants