Skip to content

Releases: ocaml-ppx/ppxlib

0.37.0

10 Oct 12:40

Choose a tag to compare

CHANGES:

5.4 Support

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. (#603, @NathanReb)

  • Fix a bug where some infix operators such as mod would be printed as
    raw identifiers by our Pprintast. (#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_ast functions via the ?printer config
    parameter. (#526, @pedrobslisboa)

0.36.2

01 Oct 08:27

Choose a tag to compare

CHANGES:

  • Make Ast_builder's default value_binding constructor generate the proper
    pvb_constraint from the pattern and expression arguments.
    (#589, @NathanReb)
  • Fix pprintast to output correct syntax from Ppat_constraint (pat, Ptyp_poly ...)
    nodes until they are completely dropped. (#588, @NathanReb)

0.36.1

10 Jul 13:56

Choose a tag to compare

CHANGES:

  • Fix ppxlib driver's AST to source printer. Our copy of pprintast was not
    properly updated which resulted in incorrect printing of value bindings'
    constraints (#585, @NathanReb)

0.36.0

03 Mar 10:35

Choose a tag to compare

CHANGES:

  • Change Location.none to match the compiler's Location.none as of OCaml
    4.08. This fixes a bug in loc_of_attribute (#540, @ncik-roberts, @patricoferris)

  • Bump ppxlib's AST to 5.2.0 (#514, @patricoferris)

  • Add the [@@@expand_inline] transformation and support for floating attribute context
    free transformations. (#560, @jaymody)

  • Add a -raise-embedded-errors flag to the driver. Setting this flag raises the first
    ocaml.error embedded in the final AST.

  • Export Ast_pattern.fail. (#563, @ceastlund)

  • Make Ast_traverse.sexp_of more concise, and add a test. (#561, @ceastlund)

0.35.0

03 Feb 10:28

Choose a tag to compare

CHANGES:

  • Allow use of effect syntax in preprocessed files without causing migration
    failures. (#552, @hhugo, @NathanReb)

  • Remove support for compilers older than 4.08 (#556, @NathanReb)

  • Add a --use-compiler-pp flag to the standalone driver. This flag
    can be set when the driver outputs source code to make it use the compiler's
    Pprintast instead of ppxlib's.
    (#555, @NathanReb)

0.34.0

06 Jan 10:24

Choose a tag to compare

CHANGES:

5.3 support

  • Add initial OCaml 5.3 support (#487, @NathanReb, @hhugo, @nojb)

  • Initialise OCaml 5.3's lexer with the keywords setting from OCAMLPARAM or
    the new -keywords driver's CLI option to allow the standalone ppx driver to
    process old packages using effect as an identifier
    (#535, @dra27, @NathanReb)

Other changes

  • Add Pprintast.binding, longident and payload (#542, @mattiasdrp)

  • Fix deriving_inline round-trip check so that it works with 5.01 <-> 5.02
    migrations (#519, @NathanReb)

  • Add ppxlib's AST pretty-printing utilities in Ppxlib.Pp_ast and
    a ppxlib-pp-ast executable in a new separate ppxlib-tools package
    (#517, #525, #537, @NathanReb)

  • Change -dparsetree from a sexp output to a pretty printed AST, closer
    to what the compiler's -dparsetree is.
    (#530, @NathanReb)

  • Add Parsetree documentation comments to Ast_builder functions (#518, @patricoferris)

  • Support class type declarations in derivers with the new, optional arguments
    {str,sig}_class_type_decl in Deriving.add (#538, @patricoferris)

0.33.0

22 Jul 09:44

Choose a tag to compare

CHANGES:

  • Fix a bug where Code_path.main_module_name would not properly remove
    extensions from the filename and therefore return an invalid module name.
    (#512, @NathanReb)

  • Add -unused-type-warnings flag to the driver to allow users to disable
    only the generation of warning 34 silencing structure items when using
    [@@deriving ...] on type declarations. (#511, @mbarbin, @NathanReb)

  • Make -unused-code-warnings flag to the driver also controls the generation
    of warning 34 silencing structure items when using [@@deriving ...] on type
    declarations. (#510, @mbarbin, @NathanReb)

  • Driver: Add -unused-code-warnings=force command-line flag argument. (#490, @mbarbin)

  • new functions Ast_builder.{e,p}list_tail that take an extra tail
    expression/pattern argument parameter compared to Ast_builder.{e,p}list, so
    they can build ASTs like a :: b :: c instead of only [ a; b ].
    (#498, #502, @v-gb, @NathanReb)

  • Fix Longident.parse so it also handles indexing operators such as
    .!(), .%(;..)<-, or Vec.(.%()) (#494, @Octachron)

  • Add a special_function' variant which directly takes a Longident.t
    argument to avoid the issue that Longident.t cover distinct syntaxic classes
    which cannot be easily parsed by a common parser (#496, @Octachron).

  • Keep location ranges consistent when migrating Pexp_function nodes from 5.2+
    to older versions (#504, @jchavarri)

  • Fix -locations-check behaviour so it is no longer required to pass -check
    as well to enable location checks. (#506, @NathanReb)

0.32.1

23 Apr 07:38

Choose a tag to compare

CHANGES:

  • Add support for OCaml 5.2

  • Insert errors from caught located exceptions in place of the code that
    should have been generated by context-free rules. (#472, @NathanReb)

0.32.0

05 Feb 08:38

Choose a tag to compare

CHANGES:

  • Add an optional embed_errors argument to Context_free.map_top_down that
    controls how to deal with exceptions thrown by context-free rules.
    (#468, @NathanReb)

  • Fix Longident.parse so it properly handles unparenthesized dotted operators
    such as +. or *.. (#111, @rgrinberg, @NathanReb)

  • raising an exception does no longer cancel the whole context free phase(#453, @Burnleydev1)

  • Sort embedded errors that are appended to the AST by location so the compiler
    reports the one closer to the beginning of the file first. (#463, @NathanReb)

  • Update Attribute.get to ignore loc_ghost. (#460, @ceastlund)

  • Add API to manipulate attributes that are used as flags (#408, @dianaoigo)

  • Update changelog to use ISO 8061 date format: YYYY-MM-DD. (#445, @ceastlund)

  • Replace Caml with Stdlib. (#427, @ceastlund)

  • When a transformation raises, the last valid AST is used as input to the upcoming
    transformations. All such errors are collected and appended as
    extension nodes to the final AST (#447, @Burnleydev1)

  • Fix a small mistake in the man pages: Embededding errors is done by default with
    -as-pp, not with -dump-ast (#464, @pitag-ha)

  • Set appropriate binary mode when writing to stdout especially for Windows
    compatibility. (#466, @jonahbeckford)

0.31.0

21 Sep 13:13

Choose a tag to compare

CHANGES:

  • Fix support for OCaml 5.1: migrated code preserves generative
    functor warnings, without creating more. Locations are better
    preserved. (#432, @pitag-ha, @panglesd)

  • Driver: Add -unused-code-warnings command-line flag. (#444, @ceastlund)

  • Add ?warning flag to Deriving.Generator.make. (#440, @jacksonzou123 via @ceastlund)

  • Restore the "path_arg" functionality in the V3 API (#431, @ELLIOTTCABLE)

  • Expose migration/copying/etc. functions for all AST types needed by Pprintast (#454, @antalsz)

  • Preserve quoted attributes on antiquotes in metaquot (#441, @ncik-roberts)

  • Attribute namespaces: Fix semantics of reserving multi-component namespaces (#443, @ncik-roberts)