Module Jane_syntax.Layouts

The ASTs for jkinds and other unboxed-types features

type constant =
  1. | Float of string * char option
  2. | Integer of string * char
type nonrec expression =
  1. | Lexp_constant of constant
  2. | Lexp_newtype of string Location.loc * Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc * Ppxlib_ast.Parsetree.expression
type nonrec pattern =
  1. | Lpat_constant of constant
type 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_ast.Parsetree.core_type;
    }
  3. | Ltyp_alias of {
    1. aliased_type : Ppxlib_ast.Parsetree.core_type;
    2. name : string option;
    3. jkind : Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc;
    }
type nonrec extension_constructor =
  1. | Lext_decl of (string Location.loc * Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc option) list * Ppxlib_ast.Parsetree.constructor_arguments * Ppxlib_ast.Parsetree.core_type option
module Pprint : sig ... end
val extension_constructor_of : loc:Location.t -> name:string Location.loc -> ?info:Docstrings.info -> ?docs:Docstrings.docs -> extension_constructor -> Ppxlib_ast.Parsetree.extension_constructor
val constructor_declaration_of : loc:Location.t -> attrs:Ppxlib_ast.Parsetree.attributes -> info:Docstrings.info -> vars_jkinds: (string Location.loc * Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc option) list -> args:Ppxlib_ast.Parsetree.constructor_arguments -> res:Ppxlib_ast.Parsetree.core_type option -> string Location.loc -> Ppxlib_ast.Parsetree.constructor_declaration

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

val of_constructor_declaration : Ppxlib_ast.Parsetree.constructor_declaration -> ((string Location.loc * Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc option) list * Ppxlib_ast.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.

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

val of_type_declaration : Ppxlib_ast.Parsetree.type_declaration -> (Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc * Ppxlib_ast.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.