package ppxlib_jane

  1. Overview
  2. Docs

Module Jane_syntax.LayoutsSource

The ASTs for jkinds and other unboxed-types features

Sourcetype constant =
  1. | Float of string * char option
  2. | Integer of string * char
Sourcetype nonrec expression =
  1. | Lexp_constant of constant
  2. | Lexp_newtype of string Location.loc * Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc * Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.expression
Sourcetype nonrec pattern =
  1. | Lpat_constant of constant
Sourcetype nonrec core_type =
  1. | Ltyp_var of {
    1. name : string option;
    2. jkind : Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc;
    }
  2. | Ltyp_poly of {
    1. bound_vars : (string Location.loc * Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc option) list;
    2. inner_type : Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.core_type;
    }
  3. | Ltyp_alias of {
    1. aliased_type : Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.core_type;
    2. name : string option;
    3. jkind : Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc;
    }
Sourcetype nonrec extension_constructor =
  1. | Lext_decl of (string Location.loc * Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc option) list * Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.constructor_arguments * Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.core_type option
Sourcemodule Pprint : sig ... end
Sourceval expr_of : loc:Location.t -> expression -> Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.expression
Sourceval pat_of : loc:Location.t -> pattern -> Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.pattern
Sourceval type_of : loc:Location.t -> core_type -> Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.core_type
Sourceval extension_constructor_of : loc:Location.t -> name:string Location.loc -> ?info:Docstrings.info -> ?docs:Docstrings.docs -> extension_constructor -> Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.extension_constructor
Sourceval constructor_declaration_of : loc:Location.t -> attrs:Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.attributes -> info:Docstrings.info -> vars_jkinds: (string Location.loc * Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc option) list -> args: Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.constructor_arguments -> res:Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.core_type option -> string Location.loc -> Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.constructor_declaration

See also Ast_helper.Type.constructor, which is a direct inspiration for the interface here.

Sourceval of_constructor_declaration : Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.constructor_declaration -> ((string Location.loc * Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc option) list * Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.attributes) option

Extract the jkinds from a constructor_declaration; returns leftover attributes along with the annotated variables. Unlike other pieces of jane-syntax, users of this function will still have to process the remaining pieces of the original constructor_declaration.

Sourceval type_declaration_of : loc:Location.t -> attrs:Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.attributes -> docs:Docstrings.docs -> text:Docstrings.text option -> params: (Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.core_type * (Ppxlib_jane__.Shadow_compiler_distribution.Asttypes.variance * Ppxlib_jane__.Shadow_compiler_distribution.Asttypes.injectivity)) list -> cstrs: (Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.core_type * Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.core_type * Location.t) list -> kind:Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.type_kind -> priv:Ppxlib_jane__.Shadow_compiler_distribution.Asttypes.private_flag -> manifest: Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.core_type option -> jkind:Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc option -> string Location.loc -> Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.type_declaration

See also Ast_helper.Type.mk, which is a direct inspiration for the interface here.

Sourceval of_type_declaration : Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.type_declaration -> (Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc * Ppxlib_jane__.Shadow_compiler_distribution.Parsetree.attributes) option

Extract the jkind annotation from a type_declaration; returns leftover attributes. Similar to of_constructor_declaration in the sense that users of this function will have to process the remaining pieces of the original type_declaration.