package ppxlib_jane

  1. Overview
  2. Docs
Utilities for working with Jane Street AST constructs

Install

Dune Dependency

Authors

Maintainers

Sources

v0.17.0.tar.gz
sha256=42757d7b44a5f2a766778e6b4710100c6ef9d0c074eb3e7fa4c69647336d8398

Description

Part of the Jane Street's PPX rewriters collection.

Published: 23 May 2024

README

'ppxlib_jane'

A library for use in ppxes for constructing and matching on ASTs corresponding to the augmented parsetree that is recognized by the Jane Street OCaml compiler.

ASTs constructed using this library are compatible with the standard OCaml compiler. Any syntax change known to this library is encoded as attributes, and the standard OCaml compiler's interpretation of the ASTs constructed by these library (which amounts to ignoring the attributes) is reasonable. That is, we only expose "unsurprising" things in this library. For example, if you construct an n-ary function using this library, the standard OCaml compiler will interpret it as n nested unary functions in the normal way.

Likewise, ppxes that use this library to match on Jane Street ASTs can also be used with the standard OCaml compiler. (The Jane Street AST cases of the match will just never be triggered when using the standard OCaml compiler.)

This is how we intend this library to fit into the broader ppx ecosystem:

+-------------+       +--------------+      +------------------+
|             |       |              |      |                  |
|    ppxes    +------>|    ppxlib    +----->+ compiler libs,   |
|             |       |              |      | ppxlib_ast, etc. |
+------+------+       +--------------+      |                  |
       |                                    +---------+--------+
       |              +---------------+               ^
       |              |               |               |
       +------------->+  ppxlib_jane  +---------------+
                      |               |
                      +---------------+

That is, there is no dependency between ppxlib and ppxlib_jane, and ppx authors are free to use ppxlib_jane if they want to construct AST nodes recognized by the Jane Street OCaml compiler.

Dependencies (3)

  1. ppxlib >= "0.28.0"
  2. dune >= "3.11.0"
  3. ocaml >= "5.1.0" & < "5.3"

Dev Dependencies

None

Used by (9)

  1. base_quickcheck >= "v0.17.0"
  2. ppx_bin_prot >= "v0.17.0"
  3. ppx_compare >= "v0.17.0"
  4. ppx_diff
  5. ppx_enumerate >= "v0.17.0"
  6. ppx_globalize >= "v0.17.0"
  7. ppx_hash >= "v0.17.0"
  8. ppx_optional >= "v0.17.0"
  9. ppx_sexp_conv >= "v0.17.0"

Conflicts

None

OCaml

Innovation. Community. Security.