0.37.0
We are pleased to announce the release of ppxlib 0.37.0. This version introduces initial support for the OCaml 5.4 compiler and provides several enhancements to AST handling and code generation.
Key Highlights
- OCaml 5.4 Support: This release includes initial support for OCaml 5.4.
- Module Derivers: Users can now derive code from module bindings and module declarations, expanding the scope of automated code generation.
- New Context-Free Rules: A new rule type has been added to replace AST nodes that have specific registered attributes attached to them.
- Astlib Enhancements: Added
Longident.to/of_compilertoastlibto simplify the maintenance of PPXs that interact with compiler-libs components like the type checker.
Bug Fixes and Improvements
- Printer Fixes: Resolved an issue where infix operators (e.g.,
mod) were incorrectly printed as raw identifiers inPprintast. - Migration Accuracy: Fixed 5.2 to 5.3 migration for constants to ensure correct location data, improving the quality of error messages.
- AST Cleanup: The AST is now automatically cleaned of ppxlib migration attributes when using
Pretty_printmode with theuse_compiler_ppflag. - Custom Printing: Added a
?printerconfiguration parameter topp_astfunctions to support custom printers.
Deprecations and API Changes
- Inline Tags: Added
@@@ppxlib.inline.endand formally deprecated@@@deriving.end. - Error Exposure:
Ppxlib.Location.Error.tis now explicitly exposed as an alias forAstlib.Location.Error.t.
See full changelog
CHANGES:
5.4 Support
- Add initial OCaml 5.4 support (#570, @patricoferris, @NathanReb)
Other Changes
-
Add
Longident.to/of_compilerto astlib to simplify maintenance
of ppx-es that interacts with other parts of the compiler-libs such
as the type checker. (#603, @NathanReb) -
Fix a bug where some infix operators such as
modwould be printed as
raw identifiers by ourPprintast. (#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.
(#569, @NathanReb) -
Add a new context-free rule type that replaces AST nodes that have the registered
attributes attached to them. (#574, @Skepfyr) -
Allow users to derive code from module bindings and module declarations
(#576, @patricoferris) -
Expose
Ppxlib.Location.Error.t = Astlib.Location.Error.t(#593, @ceastlund) -
Add
@@@ppxlib.inline.end, deprecate@@@deriving.end. (#594, @ceastlund) -
Clean the AST of any ppxlib migration attributes whenever printing using
Pretty_print mode and the use_compiler_pp flag. (#598, @patricoferris) -
Add custom printer support to
pp_astfunctions via the?printerconfig
parameter. (#526, @pedrobslisboa)