Ppxlib_jane.Jane_syntaxSyntax for Jane Street's novel syntactic features. This module provides three things:
1. First-class ASTs for all syntax introduced by our language extensions, plus one for built-in features; these are split out into a different module each (Comprehensions, etc.).
2. A first-class AST for each OCaml AST, unifying all our novel syntactic features in modules named after the syntactic category (Expression.t, etc.).
3. A way to interpret these values as terms of the coresponding OCaml ASTs, and to match on terms of those OCaml ASTs to see if they're terms from our novel syntax.
We keep our novel syntax separate so that we can avoid having to modify the existing AST, as this would break compatibility with every existing ppx and other such tooling.
For details on the rationale behind this approach (and for some of the gory details), see Jane_syntax_parsing.
module Comprehensions : sig ... endThe ASTs for list and array comprehensions
module Immutable_arrays : sig ... endThe ASTs for immutable arrays. When we merge this upstream, we'll merge these into the existing P{exp,pat}_array constructors by adding a mutable_flag argument (just as we did with T{exp,pat}_array).
module Mode_expr : sig ... endMode_expr appears in several places:
module N_ary_functions : sig ... endThese types use the P prefix to match how they are represented in the upstream compiler
module Labeled_tuples : sig ... endThe ASTs for labeled tuples. When we merge this upstream, we'll replace existing P{typ,exp,pat}_tuple constructors with these.
module Include_functor : sig ... endThe ASTs for include functor. When we merge this upstream, we'll merge these into the existing P{sig,str}_include constructors (similar to what we did with T{sig,str}_include, but without depending on typechecking).
module Strengthen : sig ... endThe ASTs for module type strengthening.
module Layouts : sig ... endThe ASTs for jkinds and other unboxed-types features
module type AST = sig ... endThe module type of our extended ASTs for our novel syntax, instantiated once for each syntactic category. We tend to call the pattern-matching functions here with unusual indentation, not indenting the None branch further so as to avoid merge conflicts with upstream.
module Core_type : sig ... endNovel syntax in types
module Constructor_argument : sig ... endNovel syntax in constructor arguments; this isn't a core AST type, but captures where global_ lives
module Expression : sig ... endNovel syntax in expressions
module Pattern : sig ... endNovel syntax in patterns
module Module_type : sig ... endNovel syntax in module types
module Signature_item : sig ... endNovel syntax in signature items
module Structure_item : sig ... endNovel syntax in structure items
module Extension_constructor : sig ... endNovel syntax in extension constructors