Ast_builder.Default
Helpers taking a ~loc
argument. This module is meant to be opened or aliased.
module Located : sig ... end
val attribute :
loc:Astlib.Location.t ->
name:string Astlib.Location.loc ->
payload:Astlib.Ast_500.Parsetree.payload ->
Astlib.Ast_500.Parsetree.attribute
val binding_op :
loc:Astlib.Location.t ->
op:string Astlib.Location.loc ->
pat:Astlib.Ast_500.Parsetree.pattern ->
exp:Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.binding_op
val case :
lhs:Astlib.Ast_500.Parsetree.pattern ->
guard:Astlib.Ast_500.Parsetree.expression option ->
rhs:Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.case
val pcl_constr :
loc:Astlib.Location.t ->
Astlib.Longident.t Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.core_type list ->
Astlib.Ast_500.Parsetree.class_expr
val pcl_structure :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.class_structure ->
Astlib.Ast_500.Parsetree.class_expr
val pcl_apply :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.class_expr ->
(Astlib.Ast_500.Asttypes.arg_label * Astlib.Ast_500.Parsetree.expression)
list ->
Astlib.Ast_500.Parsetree.class_expr
val pcl_constraint :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.class_expr ->
Astlib.Ast_500.Parsetree.class_type ->
Astlib.Ast_500.Parsetree.class_expr
val pcl_extension :
loc:Astlib.Location.t ->
(string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
Astlib.Ast_500.Parsetree.class_expr
val pcf_inherit :
loc:Astlib.Location.t ->
Astlib.Ast_500.Asttypes.override_flag ->
Astlib.Ast_500.Parsetree.class_expr ->
string Astlib.Location.loc option ->
Astlib.Ast_500.Parsetree.class_field
val pcf_val :
loc:Astlib.Location.t ->
(string Astlib.Location.loc
* Astlib.Ast_500.Asttypes.mutable_flag
* Astlib.Ast_500.Parsetree.class_field_kind) ->
Astlib.Ast_500.Parsetree.class_field
val pcf_method :
loc:Astlib.Location.t ->
(string Astlib.Location.loc
* Astlib.Ast_500.Asttypes.private_flag
* Astlib.Ast_500.Parsetree.class_field_kind) ->
Astlib.Ast_500.Parsetree.class_field
val pcf_constraint :
loc:Astlib.Location.t ->
(Astlib.Ast_500.Parsetree.core_type * Astlib.Ast_500.Parsetree.core_type) ->
Astlib.Ast_500.Parsetree.class_field
val pcf_initializer :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.class_field
val pcf_attribute :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.attribute ->
Astlib.Ast_500.Parsetree.class_field
val pcf_extension :
loc:Astlib.Location.t ->
(string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
Astlib.Ast_500.Parsetree.class_field
val class_infos :
loc:Astlib.Location.t ->
virt:Astlib.Ast_500.Asttypes.virtual_flag ->
params:
(Astlib.Ast_500.Parsetree.core_type
* (Astlib.Ast_500.Asttypes.variance * Astlib.Ast_500.Asttypes.injectivity))
list ->
name:string Astlib.Location.loc ->
expr:'a ->
'a Astlib.Ast_500.Parsetree.class_infos
val class_signature :
self:Astlib.Ast_500.Parsetree.core_type ->
fields:Astlib.Ast_500.Parsetree.class_type_field list ->
Astlib.Ast_500.Parsetree.class_signature
val class_structure :
self:Astlib.Ast_500.Parsetree.pattern ->
fields:Astlib.Ast_500.Parsetree.class_field list ->
Astlib.Ast_500.Parsetree.class_structure
val pcty_constr :
loc:Astlib.Location.t ->
Astlib.Longident.t Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.core_type list ->
Astlib.Ast_500.Parsetree.class_type
val pcty_signature :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.class_signature ->
Astlib.Ast_500.Parsetree.class_type
val pcty_extension :
loc:Astlib.Location.t ->
(string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
Astlib.Ast_500.Parsetree.class_type
val pctf_inherit :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.class_type ->
Astlib.Ast_500.Parsetree.class_type_field
val pctf_method :
loc:Astlib.Location.t ->
(string Astlib.Location.loc
* Astlib.Ast_500.Asttypes.private_flag
* Astlib.Ast_500.Asttypes.virtual_flag
* Astlib.Ast_500.Parsetree.core_type) ->
Astlib.Ast_500.Parsetree.class_type_field
val pctf_constraint :
loc:Astlib.Location.t ->
(Astlib.Ast_500.Parsetree.core_type * Astlib.Ast_500.Parsetree.core_type) ->
Astlib.Ast_500.Parsetree.class_type_field
val pctf_attribute :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.attribute ->
Astlib.Ast_500.Parsetree.class_type_field
val pctf_extension :
loc:Astlib.Location.t ->
(string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
Astlib.Ast_500.Parsetree.class_type_field
val ptyp_any : loc:Astlib.Location.t -> Astlib.Ast_500.Parsetree.core_type
val ptyp_var :
loc:Astlib.Location.t ->
string ->
Astlib.Ast_500.Parsetree.core_type
val ptyp_tuple :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.core_type list ->
Astlib.Ast_500.Parsetree.core_type
val ptyp_constr :
loc:Astlib.Location.t ->
Astlib.Longident.t Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.core_type list ->
Astlib.Ast_500.Parsetree.core_type
val ptyp_object :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.object_field list ->
Astlib.Ast_500.Asttypes.closed_flag ->
Astlib.Ast_500.Parsetree.core_type
val ptyp_class :
loc:Astlib.Location.t ->
Astlib.Longident.t Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.core_type list ->
Astlib.Ast_500.Parsetree.core_type
val ptyp_alias :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.core_type ->
string ->
Astlib.Ast_500.Parsetree.core_type
val ptyp_variant :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.row_field list ->
Astlib.Ast_500.Asttypes.closed_flag ->
string list option ->
Astlib.Ast_500.Parsetree.core_type
val ptyp_poly :
loc:Astlib.Location.t ->
string Astlib.Location.loc list ->
Astlib.Ast_500.Parsetree.core_type ->
Astlib.Ast_500.Parsetree.core_type
val ptyp_package :
loc:Astlib.Location.t ->
(Astlib.Longident.t Astlib.Location.loc
* (Astlib.Longident.t Astlib.Location.loc
* Astlib.Ast_500.Parsetree.core_type)
list) ->
Astlib.Ast_500.Parsetree.core_type
val ptyp_extension :
loc:Astlib.Location.t ->
(string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
Astlib.Ast_500.Parsetree.core_type
val pdir_string :
loc:Astlib.Location.t ->
string ->
Astlib.Ast_500.Parsetree.directive_argument
val pdir_int :
loc:Astlib.Location.t ->
string ->
char option ->
Astlib.Ast_500.Parsetree.directive_argument
val pdir_ident :
loc:Astlib.Location.t ->
Astlib.Longident.t ->
Astlib.Ast_500.Parsetree.directive_argument
val pdir_bool :
loc:Astlib.Location.t ->
bool ->
Astlib.Ast_500.Parsetree.directive_argument
val pexp_ident :
loc:Astlib.Location.t ->
Astlib.Longident.t Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.expression
val pexp_constant :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.constant ->
Astlib.Ast_500.Parsetree.expression
val pexp_let :
loc:Astlib.Location.t ->
Astlib.Ast_500.Asttypes.rec_flag ->
Astlib.Ast_500.Parsetree.value_binding list ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression
val pexp_function :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.case list ->
Astlib.Ast_500.Parsetree.expression
val pexp_apply :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression ->
(Astlib.Ast_500.Asttypes.arg_label * Astlib.Ast_500.Parsetree.expression)
list ->
Astlib.Ast_500.Parsetree.expression
val pexp_match :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.case list ->
Astlib.Ast_500.Parsetree.expression
val pexp_try :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.case list ->
Astlib.Ast_500.Parsetree.expression
val pexp_tuple :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression list ->
Astlib.Ast_500.Parsetree.expression
val pexp_construct :
loc:Astlib.Location.t ->
Astlib.Longident.t Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.expression option ->
Astlib.Ast_500.Parsetree.expression
val pexp_variant :
loc:Astlib.Location.t ->
string ->
Astlib.Ast_500.Parsetree.expression option ->
Astlib.Ast_500.Parsetree.expression
val pexp_record :
loc:Astlib.Location.t ->
(Astlib.Longident.t Astlib.Location.loc * Astlib.Ast_500.Parsetree.expression)
list ->
Astlib.Ast_500.Parsetree.expression option ->
Astlib.Ast_500.Parsetree.expression
val pexp_field :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Longident.t Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.expression
val pexp_setfield :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Longident.t Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression
val pexp_array :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression list ->
Astlib.Ast_500.Parsetree.expression
val pexp_ifthenelse :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression option ->
Astlib.Ast_500.Parsetree.expression
val pexp_sequence :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression
val pexp_while :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression
val pexp_constraint :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.core_type ->
Astlib.Ast_500.Parsetree.expression
val pexp_coerce :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.core_type option ->
Astlib.Ast_500.Parsetree.core_type ->
Astlib.Ast_500.Parsetree.expression
val pexp_send :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression ->
string Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.expression
val pexp_new :
loc:Astlib.Location.t ->
Astlib.Longident.t Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.expression
val pexp_setinstvar :
loc:Astlib.Location.t ->
string Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression
val pexp_override :
loc:Astlib.Location.t ->
(string Astlib.Location.loc * Astlib.Ast_500.Parsetree.expression) list ->
Astlib.Ast_500.Parsetree.expression
val pexp_letmodule :
loc:Astlib.Location.t ->
string option Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.module_expr ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression
val pexp_letexception :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.extension_constructor ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression
val pexp_assert :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression
val pexp_lazy :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression
val pexp_poly :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.core_type option ->
Astlib.Ast_500.Parsetree.expression
val pexp_object :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.class_structure ->
Astlib.Ast_500.Parsetree.expression
val pexp_newtype :
loc:Astlib.Location.t ->
string Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression
val pexp_pack :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.module_expr ->
Astlib.Ast_500.Parsetree.expression
val pexp_letop :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.letop ->
Astlib.Ast_500.Parsetree.expression
val pexp_extension :
loc:Astlib.Location.t ->
(string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
Astlib.Ast_500.Parsetree.expression
val pexp_unreachable :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression
val extension_constructor :
loc:Astlib.Location.t ->
name:string Astlib.Location.loc ->
kind:Astlib.Ast_500.Parsetree.extension_constructor_kind ->
Astlib.Ast_500.Parsetree.extension_constructor
val include_infos :
loc:Astlib.Location.t ->
'a ->
'a Astlib.Ast_500.Parsetree.include_infos
val label_declaration :
loc:Astlib.Location.t ->
name:string Astlib.Location.loc ->
mutable_:Astlib.Ast_500.Asttypes.mutable_flag ->
type_:Astlib.Ast_500.Parsetree.core_type ->
Astlib.Ast_500.Parsetree.label_declaration
val letop :
let_:Astlib.Ast_500.Parsetree.binding_op ->
ands:Astlib.Ast_500.Parsetree.binding_op list ->
body:Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.letop
val location :
start:Lexing.position ->
end_:Lexing.position ->
ghost:bool ->
Astlib.Location.t
val module_binding :
loc:Astlib.Location.t ->
name:string option Astlib.Location.loc ->
expr:Astlib.Ast_500.Parsetree.module_expr ->
Astlib.Ast_500.Parsetree.module_binding
val module_declaration :
loc:Astlib.Location.t ->
name:string option Astlib.Location.loc ->
type_:Astlib.Ast_500.Parsetree.module_type ->
Astlib.Ast_500.Parsetree.module_declaration
val pmod_ident :
loc:Astlib.Location.t ->
Astlib.Longident.t Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.module_expr
val pmod_structure :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.structure_item list ->
Astlib.Ast_500.Parsetree.module_expr
val pmod_functor :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.functor_parameter ->
Astlib.Ast_500.Parsetree.module_expr ->
Astlib.Ast_500.Parsetree.module_expr
val pmod_apply :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.module_expr ->
Astlib.Ast_500.Parsetree.module_expr ->
Astlib.Ast_500.Parsetree.module_expr
val pmod_constraint :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.module_expr ->
Astlib.Ast_500.Parsetree.module_type ->
Astlib.Ast_500.Parsetree.module_expr
val pmod_unpack :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.module_expr
val pmod_extension :
loc:Astlib.Location.t ->
(string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
Astlib.Ast_500.Parsetree.module_expr
val module_substitution :
loc:Astlib.Location.t ->
name:string Astlib.Location.loc ->
manifest:Astlib.Longident.t Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.module_substitution
val pmty_ident :
loc:Astlib.Location.t ->
Astlib.Longident.t Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.module_type
val pmty_signature :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.signature_item list ->
Astlib.Ast_500.Parsetree.module_type
val pmty_functor :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.functor_parameter ->
Astlib.Ast_500.Parsetree.module_type ->
Astlib.Ast_500.Parsetree.module_type
val pmty_with :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.module_type ->
Astlib.Ast_500.Parsetree.with_constraint list ->
Astlib.Ast_500.Parsetree.module_type
val pmty_typeof :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.module_expr ->
Astlib.Ast_500.Parsetree.module_type
val pmty_extension :
loc:Astlib.Location.t ->
(string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
Astlib.Ast_500.Parsetree.module_type
val pmty_alias :
loc:Astlib.Location.t ->
Astlib.Longident.t Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.module_type
val module_type_declaration :
loc:Astlib.Location.t ->
name:string Astlib.Location.loc ->
type_:Astlib.Ast_500.Parsetree.module_type option ->
Astlib.Ast_500.Parsetree.module_type_declaration
val otag :
loc:Astlib.Location.t ->
string Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.core_type ->
Astlib.Ast_500.Parsetree.object_field
val oinherit :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.core_type ->
Astlib.Ast_500.Parsetree.object_field
val open_infos :
loc:Astlib.Location.t ->
expr:'a ->
override:Astlib.Ast_500.Asttypes.override_flag ->
'a Astlib.Ast_500.Parsetree.open_infos
val ppat_any : loc:Astlib.Location.t -> Astlib.Ast_500.Parsetree.pattern
val ppat_var :
loc:Astlib.Location.t ->
string Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.pattern
val ppat_alias :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.pattern ->
string Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.pattern
val ppat_constant :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.constant ->
Astlib.Ast_500.Parsetree.pattern
val ppat_interval :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.constant ->
Astlib.Ast_500.Parsetree.constant ->
Astlib.Ast_500.Parsetree.pattern
val ppat_tuple :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.pattern list ->
Astlib.Ast_500.Parsetree.pattern
val ppat_variant :
loc:Astlib.Location.t ->
string ->
Astlib.Ast_500.Parsetree.pattern option ->
Astlib.Ast_500.Parsetree.pattern
val ppat_record :
loc:Astlib.Location.t ->
(Astlib.Longident.t Astlib.Location.loc * Astlib.Ast_500.Parsetree.pattern)
list ->
Astlib.Ast_500.Asttypes.closed_flag ->
Astlib.Ast_500.Parsetree.pattern
val ppat_array :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.pattern list ->
Astlib.Ast_500.Parsetree.pattern
val ppat_or :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.pattern ->
Astlib.Ast_500.Parsetree.pattern ->
Astlib.Ast_500.Parsetree.pattern
val ppat_constraint :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.pattern ->
Astlib.Ast_500.Parsetree.core_type ->
Astlib.Ast_500.Parsetree.pattern
val ppat_type :
loc:Astlib.Location.t ->
Astlib.Longident.t Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.pattern
val ppat_lazy :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.pattern ->
Astlib.Ast_500.Parsetree.pattern
val ppat_unpack :
loc:Astlib.Location.t ->
string option Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.pattern
val ppat_exception :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.pattern ->
Astlib.Ast_500.Parsetree.pattern
val ppat_extension :
loc:Astlib.Location.t ->
(string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
Astlib.Ast_500.Parsetree.pattern
val ppat_open :
loc:Astlib.Location.t ->
Astlib.Longident.t Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.pattern ->
Astlib.Ast_500.Parsetree.pattern
val position :
fname:string ->
lnum:int ->
bol:int ->
cnum:int ->
Lexing.position
val rtag :
loc:Astlib.Location.t ->
string Astlib.Location.loc ->
bool ->
Astlib.Ast_500.Parsetree.core_type list ->
Astlib.Ast_500.Parsetree.row_field
val rinherit :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.core_type ->
Astlib.Ast_500.Parsetree.row_field
val psig_value :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.value_description ->
Astlib.Ast_500.Parsetree.signature_item
val psig_type :
loc:Astlib.Location.t ->
Astlib.Ast_500.Asttypes.rec_flag ->
Astlib.Ast_500.Parsetree.type_declaration list ->
Astlib.Ast_500.Parsetree.signature_item
val psig_typesubst :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.type_declaration list ->
Astlib.Ast_500.Parsetree.signature_item
val psig_typext :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.type_extension ->
Astlib.Ast_500.Parsetree.signature_item
val psig_exception :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.type_exception ->
Astlib.Ast_500.Parsetree.signature_item
val psig_module :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.module_declaration ->
Astlib.Ast_500.Parsetree.signature_item
val psig_modsubst :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.module_substitution ->
Astlib.Ast_500.Parsetree.signature_item
val psig_recmodule :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.module_declaration list ->
Astlib.Ast_500.Parsetree.signature_item
val psig_modtype :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.module_type_declaration ->
Astlib.Ast_500.Parsetree.signature_item
val psig_modtypesubst :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.module_type_declaration ->
Astlib.Ast_500.Parsetree.signature_item
val psig_class :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
Astlib.Ast_500.Parsetree.signature_item
val psig_class_type :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
Astlib.Ast_500.Parsetree.signature_item
val psig_attribute :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.attribute ->
Astlib.Ast_500.Parsetree.signature_item
val psig_extension :
loc:Astlib.Location.t ->
(string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
Astlib.Ast_500.Parsetree.attribute list ->
Astlib.Ast_500.Parsetree.signature_item
val pstr_eval :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.attribute list ->
Astlib.Ast_500.Parsetree.structure_item
val pstr_value :
loc:Astlib.Location.t ->
Astlib.Ast_500.Asttypes.rec_flag ->
Astlib.Ast_500.Parsetree.value_binding list ->
Astlib.Ast_500.Parsetree.structure_item
val pstr_primitive :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.value_description ->
Astlib.Ast_500.Parsetree.structure_item
val pstr_type :
loc:Astlib.Location.t ->
Astlib.Ast_500.Asttypes.rec_flag ->
Astlib.Ast_500.Parsetree.type_declaration list ->
Astlib.Ast_500.Parsetree.structure_item
val pstr_typext :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.type_extension ->
Astlib.Ast_500.Parsetree.structure_item
val pstr_exception :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.type_exception ->
Astlib.Ast_500.Parsetree.structure_item
val pstr_module :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.module_binding ->
Astlib.Ast_500.Parsetree.structure_item
val pstr_recmodule :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.module_binding list ->
Astlib.Ast_500.Parsetree.structure_item
val pstr_modtype :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.module_type_declaration ->
Astlib.Ast_500.Parsetree.structure_item
val pstr_class :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.class_expr Astlib.Ast_500.Parsetree.class_infos list ->
Astlib.Ast_500.Parsetree.structure_item
val pstr_class_type :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
Astlib.Ast_500.Parsetree.structure_item
val pstr_attribute :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.attribute ->
Astlib.Ast_500.Parsetree.structure_item
val pstr_extension :
loc:Astlib.Location.t ->
(string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
Astlib.Ast_500.Parsetree.attribute list ->
Astlib.Ast_500.Parsetree.structure_item
val toplevel_directive :
loc:Astlib.Location.t ->
name:string Astlib.Location.loc ->
arg:Astlib.Ast_500.Parsetree.directive_argument option ->
Astlib.Ast_500.Parsetree.toplevel_directive
val type_declaration :
loc:Astlib.Location.t ->
name:string Astlib.Location.loc ->
params:
(Astlib.Ast_500.Parsetree.core_type
* (Astlib.Ast_500.Asttypes.variance * Astlib.Ast_500.Asttypes.injectivity))
list ->
cstrs:
(Astlib.Ast_500.Parsetree.core_type
* Astlib.Ast_500.Parsetree.core_type
* Astlib.Location.t)
list ->
kind:Astlib.Ast_500.Parsetree.type_kind ->
private_:Astlib.Ast_500.Asttypes.private_flag ->
manifest:Astlib.Ast_500.Parsetree.core_type option ->
Astlib.Ast_500.Parsetree.type_declaration
val type_exception :
loc:Astlib.Location.t ->
Astlib.Ast_500.Parsetree.extension_constructor ->
Astlib.Ast_500.Parsetree.type_exception
val type_extension :
loc:Astlib.Location.t ->
path:Astlib.Longident.t Astlib.Location.loc ->
params:
(Astlib.Ast_500.Parsetree.core_type
* (Astlib.Ast_500.Asttypes.variance * Astlib.Ast_500.Asttypes.injectivity))
list ->
constructors:Astlib.Ast_500.Parsetree.extension_constructor list ->
private_:Astlib.Ast_500.Asttypes.private_flag ->
Astlib.Ast_500.Parsetree.type_extension
val value_binding :
loc:Astlib.Location.t ->
pat:Astlib.Ast_500.Parsetree.pattern ->
expr:Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.value_binding
val value_description :
loc:Astlib.Location.t ->
name:string Astlib.Location.loc ->
type_:Astlib.Ast_500.Parsetree.core_type ->
prim:string list ->
Astlib.Ast_500.Parsetree.value_description
module Latest : sig ... end
This module contains updated versions of node constructors that were kept stable when the node changed. For every function in this module, there's an equally-named function outside this module. The function outside this module will stay stable, whereas the function inside this module will adapt potential upcoming new compiler features. Only use a function in this module, if the equally-named one outside this module is missing a feature you need.
val ppat_construct :
loc:Astlib.Location.t ->
Astlib.Longident.t Astlib.Location.loc ->
Astlib.Ast_500.Parsetree.pattern option ->
Astlib.Ast_500.Parsetree.pattern
val constructor_declaration :
loc:Astlib.Location.t ->
name:string Astlib.Location.loc ->
args:Astlib.Ast_500.Parsetree.constructor_arguments ->
res:Astlib.Ast_500.Parsetree.core_type option ->
Astlib.Ast_500.Parsetree.constructor_declaration
val eint : loc:Location.t -> int -> Astlib.Ast_500.Parsetree.expression
val echar : loc:Location.t -> char -> Astlib.Ast_500.Parsetree.expression
val estring : loc:Location.t -> string -> Astlib.Ast_500.Parsetree.expression
val efloat : loc:Location.t -> string -> Astlib.Ast_500.Parsetree.expression
val eint32 : loc:Location.t -> int32 -> Astlib.Ast_500.Parsetree.expression
val eint64 : loc:Location.t -> int64 -> Astlib.Ast_500.Parsetree.expression
val enativeint :
loc:Location.t ->
nativeint ->
Astlib.Ast_500.Parsetree.expression
val ebool : loc:Location.t -> bool -> Astlib.Ast_500.Parsetree.expression
val pint : loc:Location.t -> int -> Astlib.Ast_500.Parsetree.pattern
val pchar : loc:Location.t -> char -> Astlib.Ast_500.Parsetree.pattern
val pstring : loc:Location.t -> string -> Astlib.Ast_500.Parsetree.pattern
val pfloat : loc:Location.t -> string -> Astlib.Ast_500.Parsetree.pattern
val pint32 : loc:Location.t -> int32 -> Astlib.Ast_500.Parsetree.pattern
val pint64 : loc:Location.t -> int64 -> Astlib.Ast_500.Parsetree.pattern
val pnativeint :
loc:Location.t ->
nativeint ->
Astlib.Ast_500.Parsetree.pattern
val pbool : loc:Location.t -> bool -> Astlib.Ast_500.Parsetree.pattern
val eunit : loc:Location.t -> Astlib.Ast_500.Parsetree.expression
val punit : loc:Location.t -> Astlib.Ast_500.Parsetree.pattern
val evar : loc:Location.t -> string -> Astlib.Ast_500.Parsetree.expression
evar id
produces a Pexp_ident _
expression, it parses its input so you can pass any dot-separated identifier, for instance: evar ~loc "Foo.bar"
.
val pvar : loc:Location.t -> string -> Astlib.Ast_500.Parsetree.pattern
val eapply :
loc:Location.t ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression list ->
Astlib.Ast_500.Parsetree.expression
Same as pexp_apply but without labels
val eabstract :
loc:Location.t ->
Astlib.Ast_500.Parsetree.pattern list ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression
val esequence :
loc:Location.t ->
Astlib.Ast_500.Parsetree.expression list ->
Astlib.Ast_500.Parsetree.expression
val ppat_tuple_opt :
loc:Location.t ->
Astlib.Ast_500.Parsetree.pattern list ->
Astlib.Ast_500.Parsetree.pattern option
val pexp_tuple_opt :
loc:Location.t ->
Astlib.Ast_500.Parsetree.expression list ->
Astlib.Ast_500.Parsetree.expression option
val pconstruct :
Astlib.Ast_500.Parsetree.constructor_declaration ->
Astlib.Ast_500.Parsetree.pattern option ->
Astlib.Ast_500.Parsetree.pattern
val econstruct :
Astlib.Ast_500.Parsetree.constructor_declaration ->
Astlib.Ast_500.Parsetree.expression option ->
Astlib.Ast_500.Parsetree.expression
val elist_tail :
loc:Location.t ->
Astlib.Ast_500.Parsetree.expression list ->
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression
elist_tail ~loc [expr1; expr2; expr3] expr_tail
produces the expression expr1::expr2::expr3::expr_tail
.
val elist :
loc:Location.t ->
Astlib.Ast_500.Parsetree.expression list ->
Astlib.Ast_500.Parsetree.expression
elist ~loc [expr1; expr2; expr3]
produces the list litteral expression [expr1; expr2; expr3]
.
val plist_tail :
loc:Location.t ->
Astlib.Ast_500.Parsetree.pattern list ->
Astlib.Ast_500.Parsetree.pattern ->
Astlib.Ast_500.Parsetree.pattern
plist_tail ~loc [pat1; pat2; pat3] pat_tail
produces the pattern pat1::pat2::pat3::pat_tail
.
val plist :
loc:Location.t ->
Astlib.Ast_500.Parsetree.pattern list ->
Astlib.Ast_500.Parsetree.pattern
plist ~loc [pat1; pat2; pat3]
produces the list pattern [pat1; pat2; pat3]
.
val pstr_value_list :
loc:Location.t ->
Ppxlib_ast.Asttypes.rec_flag ->
Astlib.Ast_500.Parsetree.value_binding list ->
Astlib.Ast_500.Parsetree.structure_item list
pstr_value_list ~loc rf vbs
= pstr_value ~loc rf vbs
if vbs <> []
, []
otherwise.
val nonrec_type_declaration :
loc:Location.t ->
name:string Loc.t ->
params:
(Astlib.Ast_500.Parsetree.core_type * Ppxlib_ast.Asttypes.variance) list ->
cstrs:
(Astlib.Ast_500.Parsetree.core_type
* Astlib.Ast_500.Parsetree.core_type
* Location.t)
list ->
kind:Astlib.Ast_500.Parsetree.type_kind ->
private_:Ppxlib_ast.Asttypes.private_flag ->
manifest:Astlib.Ast_500.Parsetree.core_type option ->
Astlib.Ast_500.Parsetree.type_declaration
val unapplied_type_constr_conv :
loc:Location.t ->
Longident.t Loc.t ->
f:(string -> string) ->
Astlib.Ast_500.Parsetree.expression
unapplied_type_constr_conv
is the standard way to map identifiers to conversion fonctions, for preprocessor that creates values that follow the structure of types. More precisely, path_conv path (sprintf "sexp_of_%s")
is:
type_constr_conv
also applies it to a list of expression, which both prevents the compiler from allocating useless closures, and almost always what is needed, since type constructors are always applied.val type_constr_conv :
loc:Location.t ->
Longident.t Loc.t ->
f:(string -> string) ->
Astlib.Ast_500.Parsetree.expression list ->
Astlib.Ast_500.Parsetree.expression
val eta_reduce :
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression option
Tries to simplify fun v1 v2 .. -> f v1 v2 ..
into f
. Only works when f
is a path, not an arbitrary expression as that would change the meaning of the code. This can be used either for cleaning up the generated code, or to reduce allocation if f
is a local variable (the compiler won't optimize the allocation of the closure).
Eta-reduction can change the types/behavior in some corner cases that are unlikely to show up in generated code:
f
has optional arguments, eta-expanding f
can drop themf
does side effects before receiving all its arguments, and if the eta-expansion is partially applied, eta-reducing could change behavior.eta_reduce_if_possible_and_nonrec
is meant for the case where the resulting expression is going to be bound in a potentially recursive let-binding, where we have to keep the eta-expansion when rec_flag
is Recursive
to avoid a compile error.
val eta_reduce_if_possible :
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression
val eta_reduce_if_possible_and_nonrec :
Astlib.Ast_500.Parsetree.expression ->
rec_flag:Astlib.Ast_500.Asttypes.rec_flag ->
Astlib.Ast_500.Parsetree.expression