Jane_syntax.LayoutsThe ASTs for jkinds and other unboxed-types features
type nonrec expression = | Lexp_constant of constant| Lexp_newtype of string Location.loc
* Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc
* Ppxlib_ast.Parsetree.expressiontype nonrec core_type = | Ltyp_var of {name : string option;jkind : Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc;}| Ltyp_poly of {bound_vars : (string Location.loc
* Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc option)
list;inner_type : Ppxlib_ast.Parsetree.core_type;}| Ltyp_alias of {aliased_type : Ppxlib_ast.Parsetree.core_type;name : string option;jkind : Ppxlib_jane__.Jane_asttypes.const_jkind Location.loc;}type nonrec extension_constructor = | 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 optionmodule Pprint : sig ... endval expr_of : loc:Location.t -> expression -> Ppxlib_ast.Parsetree.expressionval pat_of : loc:Location.t -> pattern -> Ppxlib_ast.Parsetree.patternval type_of : loc:Location.t -> core_type -> Ppxlib_ast.Parsetree.core_typeval extension_constructor_of :
loc:Location.t ->
name:string Location.loc ->
?info:Docstrings.info ->
?docs:Docstrings.docs ->
extension_constructor ->
Ppxlib_ast.Parsetree.extension_constructorval 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_declarationSee 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)
optionExtract 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_declarationSee 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)
optionExtract 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.