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 * Jkind.annotation * Astlib.Ast_414.Parsetree.expression
Sourcetype nonrec pattern =
  1. | Lpat_constant of constant
Sourcetype nonrec core_type =
  1. | Ltyp_var of {
    1. name : string option;
    2. jkind : Jkind.annotation;
    }
  2. | Ltyp_poly of {
    1. bound_vars : (string Location.loc * Jkind.annotation option) list;
    2. inner_type : Astlib.Ast_414.Parsetree.core_type;
    }
  3. | Ltyp_alias of {
    1. aliased_type : Astlib.Ast_414.Parsetree.core_type;
    2. name : string option;
    3. jkind : Jkind.annotation;
    }
Sourcetype nonrec extension_constructor =
  1. | Lext_decl of (string Location.loc * Jkind.annotation option) list * Astlib.Ast_414.Parsetree.constructor_arguments * Astlib.Ast_414.Parsetree.core_type option
Sourcetype signature_item =
  1. | Lsig_kind_abbrev of string Location.loc * Jkind.annotation
Sourcetype structure_item =
  1. | Lstr_kind_abbrev of string Location.loc * Jkind.annotation

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

Sourceval of_constructor_declaration : Astlib.Ast_414.Parsetree.constructor_declaration -> ((string Location.loc * Jkind.annotation option) list * Astlib.Ast_414.Parsetree.attribute list) 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.

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.