Module Ppxlib_janeSource
This file can have a different implementation in the Jane Street experimental compiler and the upstream compiler, allowing ppxes to easily work with both versions
Jane Street-internal extensions to Ppxlib.Ast_builder. The bindings below (Default, Make, etc.) are parallel to bindings exported from Ppxlib.Ast_builder.
Use of this module is discouraged.
A human-readable name for the language feature corresponding to the construct.
The literal name of the constructor corresponding to the construct (e.g. Pexp_ident)
Common helper functions
val get_type_param_name_and_jkind :
(Ppxlib_ast.Parsetree.core_type
* (Ppxlib_ast.Asttypes.variance * Ppxlib_ast.Asttypes.injectivity)) ->
string Location.loc * Ppxlib_jane.Shim.jkind_annotation optionSimilar to Ppxlib.get_type_param_name, but also tells you the jkind of the variable. Raises a located error in case of failure. The type parameter should not be _. One way to ensure this is to get the type from Ppxlib.name_type_params_in_td (or one of the similarly-named functions).
val get_type_param_name_and_jkind_of_core_type :
Ppxlib_ast.Parsetree.core_type ->
string Location.loc * Ppxlib_jane.Shim.jkind_annotation optionCheck if the parsetree is of an unlabeled tuple (i.e. all labels are None), and return the components of the tuple dropping its None labels.
val localize_include_sig :
Ppxlib_ast.Ast.include_description ->
Ppxlib_ast.Ast.include_descriptionModifies an include_description to append "__local" to the module type name. In particular, this is useful for modifying the result of Ppxlib.mk_named_sig. For example, if the latter produces some incl representing include Bin_prot.Binable.S1 with type 'a t := 'a t, calling localize_include_sig incl will turn this into include Bin_prot.Binable.S1__local with type 'a t := 'a t.
val stackify_include_sig :
Ppxlib_ast.Ast.include_description ->
Ppxlib_ast.Ast.include_descriptionLike localize_include_sig, but appends "__stack" rather than "__local".
val append_arbitrary_suffix_to_include_signature :
Ppxlib_ast.Ast.include_description ->
suffix:string ->
Ppxlib_ast.Ast.include_descriptionLike localize_include_sig, but appends an arbitrary suffix.
This is useful when the suffix for your signature is not a standard mangling suffix as produced by ppx_template.
Common Jane Street helper types
type arrow_result = Shim.arrow_result = {result_modes : Ppxlib_jane.modes;result_type : Ppxlib_ast.Parsetree.core_type;
}type arrow_argument = Shim.arrow_argument = {arg_label : Ppxlib_ast.Asttypes.arg_label;arg_modes : Ppxlib_jane.modes;arg_type : Ppxlib_ast.Parsetree.core_type;
}type jkind_annotation_desc = Shim.jkind_annotation_desc = | Pjk_default| Pjk_abbreviation of string| Pjk_mod of Shim.jkind_annotation * Shim.Modes.t| Pjk_with of Shim.jkind_annotation * Ppxlib_ast.Parsetree.core_type * Shim.Modalities.t| Pjk_kind_of of Ppxlib_ast.Parsetree.core_type| Pjk_product of Shim.jkind_annotation list
type jkind_annotation = Shim.jkind_annotation = {pjkind_loc : Location.t;pjkind_desc : Shim.jkind_annotation_desc;
}