Skip to content

Always use @ local rather than local_ syntax in types#142

Merged
nmatschke merged 4 commits into
janefrom
nmatschke.always-print-at-local-in-types
May 21, 2026
Merged

Always use @ local rather than local_ syntax in types#142
nmatschke merged 4 commits into
janefrom
nmatschke.always-print-at-local-in-types

Conversation

@nmatschke
Copy link
Copy Markdown

Make ocamlformat print T @ local rather than local_ T, even if the user wrote the latter.

We insert local in sorted order amongst the other modes.

This was 100% written by claude.

@nmatschke nmatschke force-pushed the nmatschke.always-print-at-local-in-types branch from 357976b to d2f9b44 Compare May 15, 2026 16:34
Copy link
Copy Markdown

@dvulakh dvulakh left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for making the requested changes.

I was surprised that there were no changes needed to the std ast normalization pass, but it seems local_ and @ local do indeed parse the same even in ocamlformat's stdast.

In case you haven't seen it:

dune exec tools/printast/printast.exe --

is a handy tool for inspecting the behavior of ocamlformat's parsers.

@nmatschke nmatschke merged commit d9c82d3 into jane May 21, 2026
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