Skip to content

4.2.0

Latest

Choose a tag to compare

@mjambon mjambon released this 26 Apr 04:44
· 6 commits to master since this release

CHANGES:

  • atdj: Top-level list aliases such as type items = item list are now
    supported. A wrapper class (e.g. Items) implementing Atdj is generated
    with the same interface as record classes: a no-arg constructor, a
    constructor from ArrayList<T>, a constructor from a JSON string, a
    package-private constructor from JSONArray, toJsonBuffer, toJson,
    and a public value field of type ArrayList<T>. List aliases used as
    record fields or sum-variant payloads are also handled correctly.

  • atdml: Generate jsonlike_of_foo serializer functions and Foo.to_jsonlike
    submodule bindings, completing the OCaml ↔ Atd_jsonlike.AST.t round-trip.
    JSON adapters are also supported: if the adapter module M provides
    restore_jsonlike, it is called after serialization by jsonlike_of_foo.

  • atd-jsonlike: Add Pos.zero and Loc.zero — zero-position / zero-location
    constants useful for constructing AST.t nodes programmatically when source
    location information is not available.

  • atd-yamlx: Add to_yamlx_value : Atd_jsonlike.AST.t -> YAMLx.value, the
    reverse of of_yamlx_value. Enables programmatic construction of YAML
    documents from ATD-typed OCaml values via jsonlike_of_foo.