package ppxlib_jane

  1. Overview
  2. Docs

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
type nonrec pattern =
  1. | Lpat_constant of constant
type nonrec core_type
type nonrec extension_constructor
module Pprint : sig ... end
val expr_of : loc:Location.t -> expression -> Ppxlib_ast.Parsetree.expression
val pat_of : loc:Location.t -> pattern -> Ppxlib_ast.Parsetree.pattern
val type_of : loc:Location.t -> core_type -> Ppxlib_ast.Parsetree.core_type
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.

val type_declaration_of : loc:Location.t -> attrs:Ppxlib_ast.Parsetree.attributes -> docs:Docstrings.docs -> text:Docstrings.text option -> params: (Ppxlib_ast.Parsetree.core_type * (Ppxlib_ast.Asttypes.variance * Ppxlib_ast.Asttypes.injectivity)) list -> cstrs: (Ppxlib_ast.Parsetree.core_type * Ppxlib_ast.Parsetree.core_type * Location.t) list -> kind:Ppxlib_ast.Parsetree.type_kind -> priv:Ppxlib_ast.Asttypes.private_flag -> manifest:Ppxlib_ast.Parsetree.core_type option -> jkind:Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc option -> string Location.loc -> Ppxlib_ast.Parsetree.type_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.

OCaml

Innovation. Community. Security.