close
Skip to content

Add @@@ppxlib.inline.end, deprecate @@@deriving.end#594

Merged
NathanReb merged 4 commits into
ocaml-ppx:mainfrom
janestreet:ppxlib.end
Sep 16, 2025
Merged

Add @@@ppxlib.inline.end, deprecate @@@deriving.end#594
NathanReb merged 4 commits into
ocaml-ppx:mainfrom
janestreet:ppxlib.end

Conversation

@ceastlund
Copy link
Copy Markdown
Collaborator

Replace deriving.end with inline.end so the attribute makes more sense in the context of, e.g., @@expand_inline. Deprecate the old name for the attribute, with a command-line flag to allow it.

ceastlund added a commit to janestreet/ppxlib that referenced this pull request Aug 28, 2025
Signed-off-by: Carl Eastlund <ceastlund@janestreet.com>
@ceastlund ceastlund marked this pull request as ready for review August 28, 2025 19:05
Copy link
Copy Markdown
Collaborator

@NathanReb NathanReb left a comment

Choose a reason for hiding this comment

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

How about first having a version that supports both, then, in a subsequent release, do the deprecation? That would allow a smoother migration scenario.

I'd be okay to merge the code as it is if we simply always enable the flag.

@ceastlund
Copy link
Copy Markdown
Collaborator Author

There's very little code affected by this, and it's mostly jane street code that has already switched over internally. A two-phase process seems like overkill.

@panglesd
Copy link
Copy Markdown
Collaborator

panglesd commented Sep 3, 2025

I'm not sure how to read this [@@@deriving.end] search: it says 4.2k files, but only displays 5 pages of roughly 20 files per page...

(Note an ocaml.org tutorial mentioning [@@@deriving.end] that will have to be updated).

Sherlodoc finds less results.

@ceastlund
Copy link
Copy Markdown
Collaborator Author

Okay, I changed it to undeprecated by default. I also added some tests of the behavior, and of the flag to deprecate/undeprecate.

…o allow it.

Signed-off-by: Carl Eastlund <ceastlund@janestreet.com>
Signed-off-by: Carl Eastlund <ceastlund@janestreet.com>
… and undeprecated behavior.

Signed-off-by: Carl Eastlund <ceastlund@janestreet.com>
@ceastlund ceastlund force-pushed the ppxlib.end branch 2 times, most recently from 86bcda3 to e1368c8 Compare September 15, 2025 21:43
…r without patdiff.

Signed-off-by: Carl Eastlund <ceastlund@janestreet.com>
Copy link
Copy Markdown
Collaborator

@NathanReb NathanReb left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!

Sorry for the hassle, I'll take care of swapping the swapping the flag for the +1 release to make it deprecated by default!

@NathanReb NathanReb merged commit a5be80d into ocaml-ppx:main Sep 16, 2025
6 of 8 checks passed
NathanReb added a commit to NathanReb/opam-repository that referenced this pull request Oct 10, 2025
CHANGES:

### 5.4 Support

- Add initial OCaml 5.4 support (ocaml-ppx/ppxlib#570, @patricoferris, @NathanReb)

### Other Changes

- Add `Longident.to/of_compiler` to astlib to simplify maintenance
  of ppx-es that interacts with other parts of the compiler-libs such
  as the type checker. (ocaml-ppx/ppxlib#603, @NathanReb)

- Fix a bug where some infix operators such as `mod` would be printed as
  raw identifiers by our `Pprintast`. (ocaml-ppx/ppxlib#601, @NathanReb)

- Fix 5.2 -> 5.3 migration of constants. Those used to always have a `none`
  location which can lead to unhelpful error messages.
  (ocaml-ppx/ppxlib#569, @NathanReb)

- Add a new context-free rule type that replaces AST nodes that have the registered
  attributes attached to them. (ocaml-ppx/ppxlib#574, @Skepfyr)

- Allow users to derive code from module bindings and module declarations
  (ocaml-ppx/ppxlib#576, @patricoferris)

- Expose `Ppxlib.Location.Error.t = Astlib.Location.Error.t` (ocaml-ppx/ppxlib#593, @ceastlund)

- Add `@@@ppxlib.inline.end`, deprecate `@@@deriving.end`. (ocaml-ppx/ppxlib#594, @ceastlund)

- Clean the AST of any ppxlib migration attributes whenever printing using
  Pretty_print mode and the use_compiler_pp flag. (ocaml-ppx/ppxlib#598, @patricoferris)

- Add custom printer support to `pp_ast` functions via the `?printer` config
  parameter. (ocaml-ppx/ppxlib#526, @pedrobslisboa)
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.

3 participants