diff --git a/ppx_trace/_doc-dir/CHANGES.md b/ppx_trace/_doc-dir/CHANGES.md index 2721a13..a563d37 100644 --- a/ppx_trace/_doc-dir/CHANGES.md +++ b/ppx_trace/_doc-dir/CHANGES.md @@ -1,3 +1,7 @@ +# 0.9 + +- add an extensible sum type, so users can implement custom events. For example + an OTEL collector can provide custom events to link two spans to one another. # 0.8 diff --git a/ppxlib/Astlib/Compiler_pprintast/index.html b/ppxlib/Astlib/Compiler_pprintast/index.html new file mode 100644 index 0000000..0f3987d --- /dev/null +++ b/ppxlib/Astlib/Compiler_pprintast/index.html @@ -0,0 +1,14 @@ + +
Astlib.Compiler_pprintastinclude module type of struct include Ocaml_common.Pprintast endtype space_formatter = (unit, Stdlib.Format.formatter, unit) formatval longident : Stdlib.Format.formatter -> Longident.t -> unitval expression : Stdlib.Format.formatter -> Parsetree.expression -> unitval string_of_expression : Parsetree.expression -> stringval pattern : Stdlib.Format.formatter -> Parsetree.pattern -> unitval core_type : Stdlib.Format.formatter -> Parsetree.core_type -> unitval signature : Stdlib.Format.formatter -> Parsetree.signature -> unitval structure : Stdlib.Format.formatter -> Parsetree.structure -> unitval string_of_structure : Parsetree.structure -> stringval module_expr : Stdlib.Format.formatter -> Parsetree.module_expr -> unitval toplevel_phrase :
+ Stdlib.Format.formatter ->
+ Parsetree.toplevel_phrase ->
+ unitval top_phrase : Stdlib.Format.formatter -> Parsetree.toplevel_phrase -> unitval class_field : Stdlib.Format.formatter -> Parsetree.class_field -> unitval class_type_field :
+ Stdlib.Format.formatter ->
+ Parsetree.class_type_field ->
+ unitval class_expr : Stdlib.Format.formatter -> Parsetree.class_expr -> unitval class_type : Stdlib.Format.formatter -> Parsetree.class_type -> unitval module_type : Stdlib.Format.formatter -> Parsetree.module_type -> unitval binding : Stdlib.Format.formatter -> Parsetree.value_binding -> unitval payload : Stdlib.Format.formatter -> Parsetree.payload -> unitval tyvar : Stdlib.Format.formatter -> string -> unitPrint a type variable name, taking care of the special treatment required for the single quote character in second position.
val structure_item :
+ Stdlib.Format.formatter ->
+ Parsetree.structure_item ->
+ unitval signature_item :
+ Stdlib.Format.formatter ->
+ Parsetree.signature_item ->
+ unitAstlib.KeywordAstlib.Keywordval string_of_expression : Ast_414.Parsetree.expression -> stringval top_phrase :
Stdlib.Format.formatter ->
Ast_414.Parsetree.toplevel_phrase ->
- unitval core_type : Stdlib.Format.formatter -> Ast_414.Parsetree.core_type -> unitval pattern : Stdlib.Format.formatter -> Ast_414.Parsetree.pattern -> unitval signature : Stdlib.Format.formatter -> Ast_414.Parsetree.signature -> unitval structure : Stdlib.Format.formatter -> Ast_414.Parsetree.structure -> unitval string_of_structure : Ast_414.Parsetree.structure -> stringval core_type : Stdlib.Format.formatter -> Ast_414.Parsetree.core_type -> unitval pattern : Stdlib.Format.formatter -> Ast_414.Parsetree.pattern -> unitval signature : Stdlib.Format.formatter -> Ast_414.Parsetree.signature -> unitval structure : Stdlib.Format.formatter -> Ast_414.Parsetree.structure -> unitval string_of_structure : Ast_414.Parsetree.structure -> stringval binding :
+ Stdlib.Format.formatter ->
+ Ast_414.Parsetree.value_binding ->
+ unitval longident : Stdlib.Format.formatter -> Longident.t -> unitval payload : Stdlib.Format.formatter -> Ast_414.Parsetree.payload -> unitval class_expr :
Stdlib.Format.formatter ->
Ast_414.Parsetree.class_expr ->
unitval class_field :
diff --git a/ppxlib/Astlib/index.html b/ppxlib/Astlib/index.html
index d6988b9..a2c7e62 100644
--- a/ppxlib/Astlib/index.html
+++ b/ppxlib/Astlib/index.html
@@ -1,2 +1,2 @@
-Astlib (ppxlib.Astlib) Module Astlib
module Ast_402 : sig ... endmodule Ast_403 : sig ... endmodule Ast_404 : sig ... endmodule Ast_405 : sig ... endmodule Ast_406 : sig ... endmodule Ast_407 : sig ... endmodule Ast_408 : sig ... endmodule Ast_409 : sig ... endmodule Ast_410 : sig ... endmodule Ast_411 : sig ... endmodule Ast_412 : sig ... endmodule Ast_413 : sig ... endmodule Ast_414 : sig ... endmodule Ast_500 : sig ... endmodule Ast_501 : sig ... endmodule Ast_502 : sig ... endmodule Ast_503 : sig ... endmodule Migrate_402_403 : sig ... endmodule Migrate_403_402 : sig ... endmodule Migrate_403_404 : sig ... endmodule Migrate_404_403 : sig ... endmodule Migrate_404_405 : sig ... endmodule Migrate_405_404 : sig ... endmodule Migrate_405_406 : sig ... endmodule Migrate_406_405 : sig ... endmodule Migrate_406_407 : sig ... endmodule Migrate_407_406 : sig ... endmodule Migrate_407_408 : sig ... endmodule Migrate_408_407 : sig ... endmodule Migrate_408_409 : sig ... endmodule Migrate_409_408 : sig ... endmodule Migrate_409_410 : sig ... endmodule Migrate_410_409 : sig ... endmodule Migrate_410_411 : sig ... endmodule Migrate_411_410 : sig ... endmodule Migrate_411_412 : sig ... endmodule Migrate_412_411 : sig ... endmodule Migrate_412_413 : sig ... endmodule Migrate_413_412 : sig ... endmodule Migrate_413_414 : sig ... endmodule Migrate_414_413 : sig ... endmodule Migrate_414_500 : sig ... endmodule Migrate_500_414 : sig ... endmodule Migrate_500_501 : sig ... endmodule Migrate_501_500 : sig ... endmodule Migrate_501_502 : sig ... endmodule Migrate_502_501 : sig ... endmodule Migrate_502_503 : sig ... endmodule Migrate_503_502 : sig ... endmodule Ast_metadata : sig ... endMeta data related interface for a ppx rewriter
module Config : sig ... endMagic numbers
module Keyword : sig ... endmodule Location : sig ... endSource code locations (ranges of positions), used in parsetrees
module Longident : sig ... endLong identifiers, used in parsetrees.
module Parse : sig ... endEntry points in the parser
module Pprintast : sig ... end
\ No newline at end of file
+Astlib (ppxlib.Astlib) Module Astlib
module Ast_402 : sig ... endmodule Ast_403 : sig ... endmodule Ast_404 : sig ... endmodule Ast_405 : sig ... endmodule Ast_406 : sig ... endmodule Ast_407 : sig ... endmodule Ast_408 : sig ... endmodule Ast_409 : sig ... endmodule Ast_410 : sig ... endmodule Ast_411 : sig ... endmodule Ast_412 : sig ... endmodule Ast_413 : sig ... endmodule Ast_414 : sig ... endmodule Ast_500 : sig ... endmodule Ast_501 : sig ... endmodule Ast_502 : sig ... endmodule Ast_503 : sig ... endmodule Migrate_402_403 : sig ... endmodule Migrate_403_402 : sig ... endmodule Migrate_403_404 : sig ... endmodule Migrate_404_403 : sig ... endmodule Migrate_404_405 : sig ... endmodule Migrate_405_404 : sig ... endmodule Migrate_405_406 : sig ... endmodule Migrate_406_405 : sig ... endmodule Migrate_406_407 : sig ... endmodule Migrate_407_406 : sig ... endmodule Migrate_407_408 : sig ... endmodule Migrate_408_407 : sig ... endmodule Migrate_408_409 : sig ... endmodule Migrate_409_408 : sig ... endmodule Migrate_409_410 : sig ... endmodule Migrate_410_409 : sig ... endmodule Migrate_410_411 : sig ... endmodule Migrate_411_410 : sig ... endmodule Migrate_411_412 : sig ... endmodule Migrate_412_411 : sig ... endmodule Migrate_412_413 : sig ... endmodule Migrate_413_412 : sig ... endmodule Migrate_413_414 : sig ... endmodule Migrate_414_413 : sig ... endmodule Migrate_414_500 : sig ... endmodule Migrate_500_414 : sig ... endmodule Migrate_500_501 : sig ... endmodule Migrate_501_500 : sig ... endmodule Migrate_501_502 : sig ... endmodule Migrate_502_501 : sig ... endmodule Migrate_502_503 : sig ... endmodule Migrate_503_502 : sig ... endmodule Ast_metadata : sig ... endMeta data related interface for a ppx rewriter
module Config : sig ... endMagic numbers
module Keyword : sig ... endmodule Location : sig ... endSource code locations (ranges of positions), used in parsetrees
module Longident : sig ... endLong identifiers, used in parsetrees.
module Parse : sig ... endEntry points in the parser
module Pprintast : sig ... endmodule Compiler_pprintast : sig ... end
\ No newline at end of file
diff --git a/ppxlib/Ppxlib/Ast_builder/Default/index.html b/ppxlib/Ppxlib/Ast_builder/Default/index.html
index b51aaf7..5f3cd49 100644
--- a/ppxlib/Ppxlib/Ast_builder/Default/index.html
+++ b/ppxlib/Ppxlib/Ast_builder/Default/index.html
@@ -1,607 +1,27 @@
-Default (ppxlib.Ppxlib.Ast_builder.Default) Module Ast_builder.Default
Helpers taking a ~loc argument. This module is meant to be opened or aliased.
module Located : sig ... endval attribute :
- loc:Astlib.Location.t ->
+Default (ppxlib.Ppxlib.Ast_builder.Default) Module Ast_builder.Default
Helpers taking a ~loc argument. This module is meant to be opened or aliased.
module Located : sig ... endValue description
val value_description :
+ loc:Location.t ->
name:string Astlib.Location.loc ->
- payload:Astlib.Ast_500.Parsetree.payload ->
- Astlib.Ast_500.Parsetree.attributeval binding_op :
- loc:Astlib.Location.t ->
- op:string Astlib.Location.loc ->
+ type_:Astlib.Ast_500.Parsetree.core_type ->
+ prim:string list ->
+ Astlib.Ast_500.Parsetree.value_descriptionvalue_description constructs an Ast.value_description
Example OCaml
Values of type value_description represents:
Value binding
val value_binding :
+ loc:Location.t ->
pat:Astlib.Ast_500.Parsetree.pattern ->
- exp:Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.binding_opval case :
- lhs:Astlib.Ast_500.Parsetree.pattern ->
- guard:Astlib.Ast_500.Parsetree.expression option ->
- rhs:Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.caseval pcl_constr :
- loc:Astlib.Location.t ->
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.class_exprval pcl_structure :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.class_structure ->
- Astlib.Ast_500.Parsetree.class_exprval pcl_fun :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Asttypes.arg_label ->
- Astlib.Ast_500.Parsetree.expression option ->
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.class_expr ->
- Astlib.Ast_500.Parsetree.class_exprval 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_exprval pcl_let :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Asttypes.rec_flag ->
- Astlib.Ast_500.Parsetree.value_binding list ->
- Astlib.Ast_500.Parsetree.class_expr ->
- Astlib.Ast_500.Parsetree.class_exprval pcl_constraint :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.class_expr ->
- Astlib.Ast_500.Parsetree.class_type ->
- Astlib.Ast_500.Parsetree.class_exprval pcl_extension :
- loc:Astlib.Location.t ->
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.class_exprval pcl_open :
- loc:Astlib.Location.t ->
- Astlib.Longident.t Astlib.Location.loc Astlib.Ast_500.Parsetree.open_infos ->
- Astlib.Ast_500.Parsetree.class_expr ->
- Astlib.Ast_500.Parsetree.class_exprval 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_fieldval 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_fieldval 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_fieldval pcf_constraint :
- loc:Astlib.Location.t ->
- (Astlib.Ast_500.Parsetree.core_type * Astlib.Ast_500.Parsetree.core_type) ->
- Astlib.Ast_500.Parsetree.class_fieldval pcf_initializer :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.class_fieldval pcf_attribute :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.attribute ->
- Astlib.Ast_500.Parsetree.class_fieldval pcf_extension :
- loc:Astlib.Location.t ->
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.class_fieldval class_infos :
- loc:Astlib.Location.t ->
- virt:Astlib.Ast_500.Asttypes.virtual_flag ->
+ expr:Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.value_bindingvalue_binding constructs an Ast.value_binding
Type extension
val type_extension :
+ loc: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 ->
- name:string Astlib.Location.loc ->
- expr:'a ->
- 'b Astlib.Ast_500.Parsetree.class_infosval class_signature :
- self:Astlib.Ast_500.Parsetree.core_type ->
- fields:Astlib.Ast_500.Parsetree.class_type_field list ->
- Astlib.Ast_500.Parsetree.class_signatureval class_structure :
- self:Astlib.Ast_500.Parsetree.pattern ->
- fields:Astlib.Ast_500.Parsetree.class_field list ->
- Astlib.Ast_500.Parsetree.class_structureval pcty_constr :
- loc:Astlib.Location.t ->
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.class_typeval pcty_signature :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.class_signature ->
- Astlib.Ast_500.Parsetree.class_typeval pcty_arrow :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Asttypes.arg_label ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.class_type ->
- Astlib.Ast_500.Parsetree.class_typeval pcty_extension :
- loc:Astlib.Location.t ->
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.class_typeval pcty_open :
- loc:Astlib.Location.t ->
- Astlib.Longident.t Astlib.Location.loc Astlib.Ast_500.Parsetree.open_infos ->
- Astlib.Ast_500.Parsetree.class_type ->
- Astlib.Ast_500.Parsetree.class_typeval pctf_inherit :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.class_type ->
- Astlib.Ast_500.Parsetree.class_type_fieldval pctf_val :
- loc:Astlib.Location.t ->
- (string Astlib.Location.loc
- * Astlib.Ast_500.Asttypes.mutable_flag
- * Astlib.Ast_500.Asttypes.virtual_flag
- * Astlib.Ast_500.Parsetree.core_type) ->
- Astlib.Ast_500.Parsetree.class_type_fieldval 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_fieldval pctf_constraint :
- loc:Astlib.Location.t ->
- (Astlib.Ast_500.Parsetree.core_type * Astlib.Ast_500.Parsetree.core_type) ->
- Astlib.Ast_500.Parsetree.class_type_fieldval pctf_attribute :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.attribute ->
- Astlib.Ast_500.Parsetree.class_type_fieldval pctf_extension :
- loc:Astlib.Location.t ->
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.class_type_fieldval ptyp_any : loc:Astlib.Location.t -> Astlib.Ast_500.Parsetree.core_typeval ptyp_var :
- loc:Astlib.Location.t ->
- string ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_arrow :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Asttypes.arg_label ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_tuple :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_constr :
- loc:Astlib.Location.t ->
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_object :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.object_field list ->
- Astlib.Ast_500.Asttypes.closed_flag ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_class :
- loc:Astlib.Location.t ->
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_alias :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.core_type ->
- string ->
- Astlib.Ast_500.Parsetree.core_typeval 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_typeval ptyp_poly :
- loc:Astlib.Location.t ->
- string Astlib.Location.loc list ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.core_typeval 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_typeval ptyp_extension :
- loc:Astlib.Location.t ->
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.core_typeval pdir_string :
- loc:Astlib.Location.t ->
- string ->
- Astlib.Ast_500.Parsetree.directive_argumentval pdir_int :
- loc:Astlib.Location.t ->
- string ->
- char option ->
- Astlib.Ast_500.Parsetree.directive_argumentval pdir_ident :
- loc:Astlib.Location.t ->
- Astlib.Longident.t ->
- Astlib.Ast_500.Parsetree.directive_argumentval pdir_bool :
- loc:Astlib.Location.t ->
- bool ->
- Astlib.Ast_500.Parsetree.directive_argumentval pexp_ident :
- loc:Astlib.Location.t ->
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expressionval pexp_constant :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.constant ->
- Astlib.Ast_500.Parsetree.expressionval 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.expressionval pexp_function :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.case list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_fun :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Asttypes.arg_label ->
- Astlib.Ast_500.Parsetree.expression option ->
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval 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.expressionval pexp_match :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.case list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_try :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.case list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_tuple :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.expression list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_construct :
- loc:Astlib.Location.t ->
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expression option ->
- Astlib.Ast_500.Parsetree.expressionval pexp_variant :
- loc:Astlib.Location.t ->
- string ->
- Astlib.Ast_500.Parsetree.expression option ->
- Astlib.Ast_500.Parsetree.expressionval 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.expressionval pexp_field :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expressionval 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.expressionval pexp_array :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.expression list ->
- Astlib.Ast_500.Parsetree.expressionval 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.expressionval pexp_sequence :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_while :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_for :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Asttypes.direction_flag ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_constraint :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.expressionval 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.expressionval pexp_send :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.expression ->
- string Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expressionval pexp_new :
- loc:Astlib.Location.t ->
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expressionval pexp_setinstvar :
- loc:Astlib.Location.t ->
- string Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_override :
- loc:Astlib.Location.t ->
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.expression) list ->
- Astlib.Ast_500.Parsetree.expressionval 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.expressionval pexp_letexception :
- loc:Astlib.Location.t ->
+ constructors:Astlib.Ast_500.Parsetree.extension_constructor list ->
+ private_:Astlib.Ast_500.Asttypes.private_flag ->
+ Astlib.Ast_500.Parsetree.type_extensiontype_extension constructs an Ast.type_extension
Example OCaml
Definition of new extensions constructors for the extensive sum type t (type t += ...).
Type exception
val type_exception :
+ loc:Location.t ->
Astlib.Ast_500.Parsetree.extension_constructor ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_assert :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_lazy :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_poly :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.core_type option ->
- Astlib.Ast_500.Parsetree.expressionval pexp_object :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.class_structure ->
- Astlib.Ast_500.Parsetree.expressionval pexp_newtype :
- loc:Astlib.Location.t ->
- string Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_pack :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.expressionval pexp_open :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.module_expr Astlib.Ast_500.Parsetree.open_infos ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_letop :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.letop ->
- Astlib.Ast_500.Parsetree.expressionval pexp_extension :
- loc:Astlib.Location.t ->
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.expressionval pexp_unreachable :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.expressionval extension_constructor :
- loc:Astlib.Location.t ->
- name:string Astlib.Location.loc ->
- kind:Astlib.Ast_500.Parsetree.extension_constructor_kind ->
- Astlib.Ast_500.Parsetree.extension_constructorval include_infos :
- loc:Astlib.Location.t ->
- 'a ->
- 'b Astlib.Ast_500.Parsetree.include_infosval 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_declarationval 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.letopval location :
- start:Stdlib.Lexing.position ->
- end_:Stdlib.Lexing.position ->
- ghost:bool ->
- Astlib.Location.tval module_binding :
- loc:Astlib.Location.t ->
- name:string option Astlib.Location.loc ->
- expr:Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_bindingval module_declaration :
- loc:Astlib.Location.t ->
- name:string option Astlib.Location.loc ->
- type_:Astlib.Ast_500.Parsetree.module_type ->
- Astlib.Ast_500.Parsetree.module_declarationval pmod_ident :
- loc:Astlib.Location.t ->
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_structure :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.structure_item list ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_functor :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.functor_parameter ->
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_apply :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_constraint :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_type ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_unpack :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_extension :
- loc:Astlib.Location.t ->
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.module_exprval module_substitution :
- loc:Astlib.Location.t ->
- name:string Astlib.Location.loc ->
- manifest:Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.module_substitutionval pmty_ident :
- loc:Astlib.Location.t ->
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_signature :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.signature_item list ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_functor :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.functor_parameter ->
- Astlib.Ast_500.Parsetree.module_type ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_with :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.module_type ->
- Astlib.Ast_500.Parsetree.with_constraint list ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_typeof :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_extension :
- loc:Astlib.Location.t ->
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_alias :
- loc:Astlib.Location.t ->
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.module_typeval 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_declarationval otag :
- loc:Astlib.Location.t ->
- string Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.object_fieldval oinherit :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.object_fieldval open_infos :
- loc:Astlib.Location.t ->
- expr:'a ->
- override:Astlib.Ast_500.Asttypes.override_flag ->
- 'b Astlib.Ast_500.Parsetree.open_infosval ppat_any : loc:Astlib.Location.t -> Astlib.Ast_500.Parsetree.patternval ppat_var :
- loc:Astlib.Location.t ->
- string Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.patternval ppat_alias :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.pattern ->
- string Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.patternval ppat_constant :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.constant ->
- Astlib.Ast_500.Parsetree.patternval ppat_interval :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.constant ->
- Astlib.Ast_500.Parsetree.constant ->
- Astlib.Ast_500.Parsetree.patternval ppat_tuple :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.pattern list ->
- Astlib.Ast_500.Parsetree.patternval ppat_variant :
- loc:Astlib.Location.t ->
- string ->
- Astlib.Ast_500.Parsetree.pattern option ->
- Astlib.Ast_500.Parsetree.patternval 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.patternval ppat_array :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.pattern list ->
- Astlib.Ast_500.Parsetree.patternval ppat_or :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.patternval ppat_constraint :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.patternval ppat_type :
- loc:Astlib.Location.t ->
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.patternval ppat_lazy :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.patternval ppat_unpack :
- loc:Astlib.Location.t ->
- string option Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.patternval ppat_exception :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.patternval ppat_extension :
- loc:Astlib.Location.t ->
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.patternval ppat_open :
- loc:Astlib.Location.t ->
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.patternval position :
- fname:string ->
- lnum:int ->
- bol:int ->
- cnum:int ->
- Stdlib.Lexing.positionval rtag :
- loc:Astlib.Location.t ->
- string Astlib.Location.loc ->
- bool ->
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.row_fieldval rinherit :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.row_fieldval psig_value :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.value_description ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_type :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Asttypes.rec_flag ->
- Astlib.Ast_500.Parsetree.type_declaration list ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_typesubst :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.type_declaration list ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_typext :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.type_extension ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_exception :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.type_exception ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_module :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.module_declaration ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_modsubst :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.module_substitution ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_recmodule :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.module_declaration list ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_modtype :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.module_type_declaration ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_modtypesubst :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.module_type_declaration ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_open :
- loc:Astlib.Location.t ->
- Astlib.Longident.t Astlib.Location.loc Astlib.Ast_500.Parsetree.open_infos ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_include :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.module_type Astlib.Ast_500.Parsetree.include_infos ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_class :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
- Astlib.Ast_500.Parsetree.signature_itemval 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_itemval psig_attribute :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.attribute ->
- Astlib.Ast_500.Parsetree.signature_itemval 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_itemval pstr_eval :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.attribute list ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_value :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Asttypes.rec_flag ->
- Astlib.Ast_500.Parsetree.value_binding list ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_primitive :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.value_description ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_type :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Asttypes.rec_flag ->
- Astlib.Ast_500.Parsetree.type_declaration list ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_typext :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.type_extension ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_exception :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.type_exception ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_module :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.module_binding ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_recmodule :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.module_binding list ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_modtype :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.module_type_declaration ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_open :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.module_expr Astlib.Ast_500.Parsetree.open_infos ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_class :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.class_expr Astlib.Ast_500.Parsetree.class_infos list ->
- Astlib.Ast_500.Parsetree.structure_itemval 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_itemval pstr_include :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.module_expr Astlib.Ast_500.Parsetree.include_infos ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_attribute :
- loc:Astlib.Location.t ->
- Astlib.Ast_500.Parsetree.attribute ->
- Astlib.Ast_500.Parsetree.structure_itemval 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_itemval toplevel_directive :
- loc:Astlib.Location.t ->
- name:string Astlib.Location.loc ->
- arg:Astlib.Ast_500.Parsetree.directive_argument option ->
- Astlib.Ast_500.Parsetree.toplevel_directiveval type_declaration :
- loc:Astlib.Location.t ->
+ Astlib.Ast_500.Parsetree.type_exceptiontype_exception constructs an Ast.type_exception
Example OCaml
Definition of a new exception (exception E).
Type declaration
val type_declaration :
+ loc:Location.t ->
name:string Astlib.Location.loc ->
params:
(Astlib.Ast_500.Parsetree.core_type
@@ -615,28 +35,603 @@
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_declarationval type_exception :
- loc:Astlib.Location.t ->
+ Astlib.Ast_500.Parsetree.type_declarationtype_declaration constructs an Ast.type_declaration
Example OCaml
Here are type declarations and their representation, for various ptype_kind and ptype_manifest values:
type t when type_kind is Ptype_abstract, and manifest is None,type t = T0 when type_kind is Ptype_abstract, and manifest is Some T0,type t = C of T | ... when type_kind is Ptype_variant, and manifest is None,type t = T0 = C of T | ... when type_kind is Ptype_variant, and manifest is Some T0,type t = {l: T; ...} when type_kind is Ptype_record, and manifest is None,type t = T0 = {l : T; ...} when type_kind is Ptype_record, and manifest is Some T0,type t = .. when type_kind is Ptype_open, and manifest is None.
Toplevel directive
val toplevel_directive :
+ loc:Location.t ->
+ name:string Astlib.Location.loc ->
+ arg:Astlib.Ast_500.Parsetree.directive_argument option ->
+ Astlib.Ast_500.Parsetree.toplevel_directivetoplevel_directive constructs an Ast.toplevel_directive
Structure item
val pstr_extension :
+ loc:Location.t ->
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.attribute list ->
+ Astlib.Ast_500.Parsetree.structure_itemval pstr_attribute :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.attribute ->
+ Astlib.Ast_500.Parsetree.structure_itemval pstr_include :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.module_expr Astlib.Ast_500.Parsetree.include_infos ->
+ Astlib.Ast_500.Parsetree.structure_itemval pstr_class_type :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_class_type constructs an Ast.structure_item_desc.Pstr_class_type
Example OCaml
class type ct1 = ... and ... and ctn = ...
val pstr_class :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.class_expr Astlib.Ast_500.Parsetree.class_infos list ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_class constructs an Ast.structure_item_desc.Pstr_class
Example OCaml
class c1 = ... and ... and cn = ...
val pstr_open :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.module_expr Astlib.Ast_500.Parsetree.open_infos ->
+ Astlib.Ast_500.Parsetree.structure_itemval pstr_modtype :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.module_type_declaration ->
+ Astlib.Ast_500.Parsetree.structure_itemval pstr_recmodule :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.module_binding list ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_recmodule constructs an Ast.structure_item_desc.Pstr_recmodule
Example OCaml
module rec X1 = ME1 and ... and Xn = MEn
val pstr_module :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.module_binding ->
+ Astlib.Ast_500.Parsetree.structure_itemval pstr_exception :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.type_exception ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_exception constructs an Ast.structure_item_desc.Pstr_exception
Example OCaml
exception C of Texception C = M.X
val pstr_typext :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.type_extension ->
+ Astlib.Ast_500.Parsetree.structure_itemval pstr_type :
+ loc:Location.t ->
+ Astlib.Ast_500.Asttypes.rec_flag ->
+ Astlib.Ast_500.Parsetree.type_declaration list ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_type constructs an Ast.structure_item_desc.Pstr_type
Example OCaml
type t1 = ... and ... and tn = ...
val pstr_primitive :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.value_description ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_primitive constructs an Ast.structure_item_desc.Pstr_primitive
Example OCaml
val x: Texternal x: T = "s1" ... "sn"
val pstr_value :
+ loc:Location.t ->
+ Astlib.Ast_500.Asttypes.rec_flag ->
+ Astlib.Ast_500.Parsetree.value_binding list ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_value constructs an Ast.structure_item_desc.Pstr_value
Example OCaml
Pstr_value(rec, [(P1, E1 ; ... ; (Pn, En))]) represents:
let P1 = E1 and ... and Pn = EN when rec is Nonrecursive,let rec P1 = E1 and ... and Pn = EN when rec is Recursive.
val pstr_eval :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.attribute list ->
+ Astlib.Ast_500.Parsetree.structure_itemSignature item
val psig_extension :
+ loc:Location.t ->
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.attribute list ->
+ Astlib.Ast_500.Parsetree.signature_itemval psig_attribute :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.attribute ->
+ Astlib.Ast_500.Parsetree.signature_itemval psig_class_type :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_class_type constructs an Ast.signature_item_desc.Psig_class_type
Example OCaml
class type ct1 = ... and ... and ctn = ...
val psig_class :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_class constructs an Ast.signature_item_desc.Psig_class
Example OCaml
class c1 : ... and ... and cn : ...
val psig_include :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.module_type Astlib.Ast_500.Parsetree.include_infos ->
+ Astlib.Ast_500.Parsetree.signature_itemval psig_open :
+ loc:Location.t ->
+ Astlib.Longident.t Astlib.Location.loc Astlib.Ast_500.Parsetree.open_infos ->
+ Astlib.Ast_500.Parsetree.signature_itemval psig_modtypesubst :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.module_type_declaration ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_modtypesubst constructs an Ast.signature_item_desc.Psig_modtypesubst
Example OCaml
module type S := ...
val psig_modtype :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.module_type_declaration ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_modtype constructs an Ast.signature_item_desc.Psig_modtype
Example OCaml
module type S = MT and module type S
val psig_recmodule :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.module_declaration list ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_recmodule constructs an Ast.signature_item_desc.Psig_recmodule
Example OCaml
module rec X1 : MT1 and ... and Xn : MTn
val psig_modsubst :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.module_substitution ->
+ Astlib.Ast_500.Parsetree.signature_itemval psig_module :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.module_declaration ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_module constructs an Ast.signature_item_desc.Psig_module
Example OCaml
module X = M and module X : MT
val psig_exception :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.type_exception ->
+ Astlib.Ast_500.Parsetree.signature_itemval psig_typext :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.type_extension ->
+ Astlib.Ast_500.Parsetree.signature_itemval psig_typesubst :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.type_declaration list ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_typesubst constructs an Ast.signature_item_desc.Psig_typesubst
Example OCaml
type t1 := ... and ... and tn := ...
val psig_type :
+ loc:Location.t ->
+ Astlib.Ast_500.Asttypes.rec_flag ->
+ Astlib.Ast_500.Parsetree.type_declaration list ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_type constructs an Ast.signature_item_desc.Psig_type
Example OCaml
type t1 = ... and ... and tn = ...
val psig_value :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.value_description ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_value constructs an Ast.signature_item_desc.Psig_value
Example OCaml
val x: Texternal x: T = "s1" ... "sn"
Row field
val rinherit :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.row_fieldval rtag :
+ loc:Location.t ->
+ string Astlib.Location.loc ->
+ bool ->
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.row_fieldrtag constructs an Ast.row_field_desc.Rtag
Example OCaml
Rtag(`A, b, l) represents:
`A when b is true and l is [],`A of T when b is false and l is [T],`A of T1 & .. & Tn when b is false and l is [T1;...Tn],`A of & T1 & .. & Tn when b is true and l is [T1;...Tn].
- The
bool field is true if the tag contains a constant (empty) constructor. & occurs when several types are used for the same constructor (see 4.2 in the manual)
Position
val position :
+ fname:string ->
+ lnum:int ->
+ bol:int ->
+ cnum:int ->
+ Stdlib.Lexing.positionposition constructs an Ast.position
Pattern
val ppat_open :
+ loc:Location.t ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.patternval ppat_extension :
+ loc:Location.t ->
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.patternval ppat_exception :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.patternval ppat_unpack :
+ loc:Location.t ->
+ string option Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.patternppat_unpack constructs an Ast.pattern_desc.Ppat_unpack
Example OCaml
Ppat_unpack(s) represents:
(module P) when s is Some "P"(module _) when s is None
Note: (module P : S) is represented as Ppat_constraint(Ppat_unpack(Some "P"), Ptyp_package S)
val ppat_lazy :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.patternval ppat_type :
+ loc:Location.t ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.patternval ppat_constraint :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.patternval ppat_or :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.patternval ppat_array :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.pattern list ->
+ Astlib.Ast_500.Parsetree.patternval ppat_record :
+ loc:Location.t ->
+ (Astlib.Longident.t Astlib.Location.loc * Astlib.Ast_500.Parsetree.pattern)
+ list ->
+ Astlib.Ast_500.Asttypes.closed_flag ->
+ Astlib.Ast_500.Parsetree.patternppat_record constructs an Ast.pattern_desc.Ppat_record
Example OCaml
Ppat_record([(l1, P1) ; ... ; (ln, Pn)], flag) represents:
Invariant: n > 0
val ppat_variant :
+ loc:Location.t ->
+ string ->
+ Astlib.Ast_500.Parsetree.pattern option ->
+ Astlib.Ast_500.Parsetree.patternppat_variant constructs an Ast.pattern_desc.Ppat_variant
Example OCaml
Ppat_variant(`A, pat) represents:
`A when pat is None,`A P when pat is Some P
val ppat_tuple :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.pattern list ->
+ Astlib.Ast_500.Parsetree.patternppat_tuple constructs an Ast.pattern_desc.Ppat_tuple
Example OCaml
Patterns (P1, ..., Pn).
Invariant: n >= 2
val ppat_interval :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.constant ->
+ Astlib.Ast_500.Parsetree.constant ->
+ Astlib.Ast_500.Parsetree.patternppat_interval constructs an Ast.pattern_desc.Ppat_interval
Example OCaml
Patterns such as 'a'..'z'.
Other forms of interval are recognized by the parser but rejected by the type-checker.
val ppat_constant :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.constant ->
+ Astlib.Ast_500.Parsetree.patternppat_constant constructs an Ast.pattern_desc.Ppat_constant
Example OCaml
Patterns such as 1, 'a', "true", 1.0, 1l, 1L, 1n
val ppat_alias :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ string Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.patternval ppat_var :
+ loc:Location.t ->
+ string Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.patternval ppat_any : loc:Location.t -> Astlib.Ast_500.Parsetree.patternObject field
val oinherit :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.object_fieldoinherit constructs an Ast.object_field_desc.Oinherit
val otag :
+ loc:Location.t ->
+ string Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.object_fieldotag constructs an Ast.object_field_desc.Otag
Module type declaration
val module_type_declaration :
+ loc:Location.t ->
+ name:string Astlib.Location.loc ->
+ type_:Astlib.Ast_500.Parsetree.module_type option ->
+ Astlib.Ast_500.Parsetree.module_type_declarationmodule_type_declaration constructs an Ast.module_type_declaration
Example OCaml
Values of type module_type_declaration represents:
S = MT,S for abstract module type declaration, when pmtd_type is None.
Module type
val pmty_alias :
+ loc:Location.t ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_extension :
+ loc:Location.t ->
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_typeof :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_with :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.module_type ->
+ Astlib.Ast_500.Parsetree.with_constraint list ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_functor :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.functor_parameter ->
+ Astlib.Ast_500.Parsetree.module_type ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_signature :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.signature_item list ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_ident :
+ loc:Location.t ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.module_typeModule substitution
val module_substitution :
+ loc:Location.t ->
+ name:string Astlib.Location.loc ->
+ manifest:Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.module_substitutionmodule_substitution constructs an Ast.module_substitution
Example OCaml
Values of type module_substitution represents S := M
Module expr
val pmod_extension :
+ loc:Location.t ->
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_unpack :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_constraint :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_type ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_apply :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_functor :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.functor_parameter ->
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_structure :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.structure_item list ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_ident :
+ loc:Location.t ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.module_exprModule declaration
val module_declaration :
+ loc:Location.t ->
+ name:string option Astlib.Location.loc ->
+ type_:Astlib.Ast_500.Parsetree.module_type ->
+ Astlib.Ast_500.Parsetree.module_declarationmodule_declaration constructs an Ast.module_declaration
Example OCaml
Values of type module_declaration represents S : MT
Module binding
val module_binding :
+ loc:Location.t ->
+ name:string option Astlib.Location.loc ->
+ expr:Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_bindingmodule_binding constructs an Ast.module_binding
Example OCaml
Values of type module_binding represents module X = ME
Location
val location :
+ start:Stdlib.Lexing.position ->
+ end_:Stdlib.Lexing.position ->
+ ghost:bool ->
+ Astlib.Location.tlocation constructs an Ast.location
Letop
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.letopletop constructs an Ast.letop
Label declaration
val label_declaration :
+ loc: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_declarationlabel_declaration constructs an Ast.label_declaration
Example OCaml
{ ...; l: T; ... } when pld_mutable is Immutable,{ ...; mutable l: T; ... } when pld_mutable is Mutable.
Note: T can be a Ptyp_poly.
Extension constructor
val extension_constructor :
+ loc:Location.t ->
+ name:string Astlib.Location.loc ->
+ kind:Astlib.Ast_500.Parsetree.extension_constructor_kind ->
+ Astlib.Ast_500.Parsetree.extension_constructorextension_constructor constructs an Ast.extension_constructor
Expression
val pexp_unreachable : loc:Location.t -> Astlib.Ast_500.Parsetree.expressionval pexp_extension :
+ loc:Location.t ->
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_letop :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.letop ->
+ Astlib.Ast_500.Parsetree.expressionpexp_letop constructs an Ast.expression_desc.Pexp_letop
Example OCaml
let* P = E0 in E1let* P0 = E00 and* P1 = E01 in E1
val pexp_open :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.module_expr Astlib.Ast_500.Parsetree.open_infos ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_open constructs an Ast.expression_desc.Pexp_open
Example OCaml
M.(E)let open M in Elet open! M in E
val pexp_pack :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.expressionpexp_pack constructs an Ast.expression_desc.Pexp_pack
Example OCaml
(module ME).
(module ME : S) is represented as Pexp_constraint(Pexp_pack ME, Ptyp_package S)
val pexp_newtype :
+ loc:Location.t ->
+ string Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_object :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.class_structure ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_poly :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.core_type option ->
+ Astlib.Ast_500.Parsetree.expressionpexp_poly constructs an Ast.expression_desc.Pexp_poly
Example OCaml
Used for method bodies.
Can only be used as the expression under Cfk_concrete for methods (not values).
val pexp_lazy :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_assert :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_assert constructs an Ast.expression_desc.Pexp_assert
Example OCaml
assert E.
Note: assert false is treated in a special way by the type-checker.
val pexp_letexception :
+ loc:Location.t ->
Astlib.Ast_500.Parsetree.extension_constructor ->
- Astlib.Ast_500.Parsetree.type_exceptionval type_extension :
- loc:Astlib.Location.t ->
- path:Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_letexception constructs an Ast.expression_desc.Pexp_letexception
Example OCaml
let exception C in E
val pexp_letmodule :
+ loc:Location.t ->
+ string option Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_override :
+ loc:Location.t ->
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.expression) list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_override constructs an Ast.expression_desc.Pexp_override
Example OCaml
{< x1 = E1; ...; xn = En >}
val pexp_setinstvar :
+ loc:Location.t ->
+ string Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_new :
+ loc:Location.t ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_send :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression ->
+ string Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_coerce :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.core_type option ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.expressionpexp_coerce constructs an Ast.expression_desc.Pexp_coerce
Example OCaml
Pexp_coerce(E, from, T) represents
(E :> T) when from is None,(E : T0 :> T) when from is Some T0.
val pexp_constraint :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_for :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Asttypes.direction_flag ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_for constructs an Ast.expression_desc.Pexp_for
Example OCaml
Pexp_for(i, E1, E2, direction, E3) represents:
val pexp_while :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_sequence :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_ifthenelse :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_array :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression list ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_setfield :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_field :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_record :
+ loc:Location.t ->
+ (Astlib.Longident.t Astlib.Location.loc * Astlib.Ast_500.Parsetree.expression)
+ list ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.expressionpexp_record constructs an Ast.expression_desc.Pexp_record
Example OCaml
Pexp_record([(l1,P1) ; ... ; (ln,Pn)], exp0) represents
{ l1=P1; ...; ln=Pn } when exp0 is None{ E0 with l1=P1; ...; ln=Pn } when exp0 is Some E0
Invariant: n > 0
val pexp_variant :
+ loc:Location.t ->
+ string ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.expressionpexp_variant constructs an Ast.expression_desc.Pexp_variant
Example OCaml
Pexp_variant(`A, exp) represents
`A when exp is None`A E when exp is Some E
val pexp_construct :
+ loc:Location.t ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.expressionpexp_construct constructs an Ast.expression_desc.Pexp_construct
Example OCaml
Pexp_construct(C, exp) represents:
C when exp is None,C E when exp is Some E,C (E1, ..., En) when exp is Some (Pexp_tuple[E1;...;En])
val pexp_tuple :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_tuple constructs an Ast.expression_desc.Pexp_tuple
Example OCaml
Expressions (E1, ..., En)
Invariant: n >= 2
val pexp_try :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.case list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_try constructs an Ast.expression_desc.Pexp_try
Example OCaml
try E0 with P1 -> E1 | ... | Pn -> En
val pexp_match :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.case list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_match constructs an Ast.expression_desc.Pexp_match
Example OCaml
match E0 with P1 -> E1 | ... | Pn -> En
val pexp_apply :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression ->
+ (Astlib.Ast_500.Asttypes.arg_label * Astlib.Ast_500.Parsetree.expression)
+ list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_apply constructs an Ast.expression_desc.Pexp_apply
Example OCaml
Pexp_apply(E0, [(l1, E1) ; ... ; (ln, En)]) represents E0 ~l1:E1 ... ~ln:En
li can be Nolabel (non labeled argument), Labelled (labelled arguments) or Optional (optional argument).
Invariant: n > 0
val pexp_fun :
+ loc:Location.t ->
+ Astlib.Ast_500.Asttypes.arg_label ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_fun constructs an Ast.expression_desc.Pexp_fun
Example OCaml
Pexp_fun(lbl, exp0, P, E1) represents:
fun P -> E1 when lbl is Nolabel and exp0 is Nonefun ~l:P -> E1 when lbl is Labelled l and exp0 is Nonefun ?l:P -> E1 when lbl is Optional l and exp0 is Nonefun ?l:(P = E0) -> E1 when lbl is Optional l and exp0 is Some E0
Notes:
val pexp_function :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.case list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_function constructs an Ast.expression_desc.Pexp_function
Example OCaml
function P1 -> E1 | ... | Pn -> En
val pexp_let :
+ loc:Location.t ->
+ Astlib.Ast_500.Asttypes.rec_flag ->
+ Astlib.Ast_500.Parsetree.value_binding list ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_let constructs an Ast.expression_desc.Pexp_let
Example OCaml
Pexp_let(flag, [(P1,E1) ; ... ; (Pn,En)], E) represents:
let P1 = E1 and ... and Pn = EN in E when flag is Nonrecursive,let rec P1 = E1 and ... and Pn = EN in E when flag is Recursive.
val pexp_constant :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.constant ->
+ Astlib.Ast_500.Parsetree.expressionpexp_constant constructs an Ast.expression_desc.Pexp_constant
Example OCaml
Expressions constant such as 1, 'a', "true", 1.0, 1l, 1L, 1n
val pexp_ident :
+ loc:Location.t ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expressionDirective argument
val pdir_bool :
+ loc:Location.t ->
+ bool ->
+ Astlib.Ast_500.Parsetree.directive_argumentpdir_bool constructs an Ast.directive_argument_desc.Pdir_bool
val pdir_ident :
+ loc:Location.t ->
+ Astlib.Longident.t ->
+ Astlib.Ast_500.Parsetree.directive_argumentpdir_ident constructs an Ast.directive_argument_desc.Pdir_ident
val pdir_int :
+ loc:Location.t ->
+ string ->
+ char option ->
+ Astlib.Ast_500.Parsetree.directive_argumentpdir_int constructs an Ast.directive_argument_desc.Pdir_int
val pdir_string :
+ loc:Location.t ->
+ string ->
+ Astlib.Ast_500.Parsetree.directive_argumentpdir_string constructs an Ast.directive_argument_desc.Pdir_string
Core type
val ptyp_extension :
+ loc:Location.t ->
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.core_typeval ptyp_package :
+ loc: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_typeval ptyp_poly :
+ loc:Location.t ->
+ string Astlib.Location.loc list ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_poly constructs an Ast.core_type_desc.Ptyp_poly
Example OCaml
'a1 ... 'an. T
Can only appear in the following context:
- As the
core_type of a Ppat_constraint node corresponding to a constraint on a let-binding:
let x : 'a1 ... 'an. T = e ...
- Under
Cfk_virtual for methods (not values).
- As the
core_type of a Pctf_method node.
- As the
pld_type field of a label_declaration.
- As a
core_type of a Ptyp_object node.
- As the
pval_type field of a value_description.
val ptyp_variant :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.row_field list ->
+ Astlib.Ast_500.Asttypes.closed_flag ->
+ string list option ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_variant constructs an Ast.core_type_desc.Ptyp_variant
Example OCaml
Ptyp_variant([`A;`B], flag, labels) represents:
val ptyp_alias :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ string ->
+ Astlib.Ast_500.Parsetree.core_typeval ptyp_class :
+ loc:Location.t ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_class constructs an Ast.core_type_desc.Ptyp_class
Example OCaml
Ptyp_class(tconstr, l) represents:
#tconstr when l=[],T #tconstr when l=[T],(T1, ..., Tn) #tconstr when l=[T1 ; ... ; Tn].
val ptyp_object :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.object_field list ->
+ Astlib.Ast_500.Asttypes.closed_flag ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_object constructs an Ast.core_type_desc.Ptyp_object
Example OCaml
Ptyp_object([ l1:T1; ...; ln:Tn ], flag) represents:
val ptyp_constr :
+ loc:Location.t ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_constr constructs an Ast.core_type_desc.Ptyp_constr
Example OCaml
Ptyp_constr(lident, l) represents:
tconstr when l=[],T tconstr when l=[T],(T1, ..., Tn) tconstr when l=[T1 ; ... ; Tn].
val ptyp_tuple :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_tuple constructs an Ast.core_type_desc.Ptyp_tuple
Example OCaml
Ptyp_tuple([T1 ; ... ; Tn]) represents a product type T1 * ... * Tn.
Invariant: n >= 2.
val ptyp_arrow :
+ loc:Location.t ->
+ Astlib.Ast_500.Asttypes.arg_label ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_arrow constructs an Ast.core_type_desc.Ptyp_arrow
Example OCaml
Ptyp_arrow(lbl, T1, T2) represents:
val ptyp_var : loc:Location.t -> string -> Astlib.Ast_500.Parsetree.core_typeval ptyp_any : loc:Location.t -> Astlib.Ast_500.Parsetree.core_typeConstructor declaration
Class type field
val pctf_extension :
+ loc:Location.t ->
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.class_type_fieldval pctf_attribute :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.attribute ->
+ Astlib.Ast_500.Parsetree.class_type_fieldval pctf_constraint :
+ loc:Location.t ->
+ (Astlib.Ast_500.Parsetree.core_type * Astlib.Ast_500.Parsetree.core_type) ->
+ Astlib.Ast_500.Parsetree.class_type_fieldpctf_constraint constructs an Ast.class_type_field_desc.Pctf_constraint
Example OCaml
constraint T1 = T2
val pctf_method :
+ loc: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_fieldpctf_method constructs an Ast.class_type_field_desc.Pctf_method
Example OCaml
method x: T
Note: T can be a Ptyp_poly.
val pctf_val :
+ loc:Location.t ->
+ (string Astlib.Location.loc
+ * Astlib.Ast_500.Asttypes.mutable_flag
+ * Astlib.Ast_500.Asttypes.virtual_flag
+ * Astlib.Ast_500.Parsetree.core_type) ->
+ Astlib.Ast_500.Parsetree.class_type_fieldval pctf_inherit :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.class_type ->
+ Astlib.Ast_500.Parsetree.class_type_fieldClass type
val pcty_open :
+ loc:Location.t ->
+ Astlib.Longident.t Astlib.Location.loc Astlib.Ast_500.Parsetree.open_infos ->
+ Astlib.Ast_500.Parsetree.class_type ->
+ Astlib.Ast_500.Parsetree.class_typeval pcty_extension :
+ loc:Location.t ->
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.class_typeval pcty_arrow :
+ loc:Location.t ->
+ Astlib.Ast_500.Asttypes.arg_label ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.class_type ->
+ Astlib.Ast_500.Parsetree.class_typepcty_arrow constructs an Ast.class_type_desc.Pcty_arrow
Example OCaml
Pcty_arrow(lbl, T, CT) represents:
T -> CT when lbl is Nolabel,~l:T -> CT when lbl is Labelled l,?l:T -> CT when lbl is Optional l.
val pcty_signature :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.class_signature ->
+ Astlib.Ast_500.Parsetree.class_typeval pcty_constr :
+ loc:Location.t ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.class_typeClass structure
val class_structure :
+ self:Astlib.Ast_500.Parsetree.pattern ->
+ fields:Astlib.Ast_500.Parsetree.class_field list ->
+ Astlib.Ast_500.Parsetree.class_structureclass_structure constructs an Ast.class_structure
Example OCaml
Values of type class_structure represents:
object(selfpat) ... endobject ... end when pcstr_self is Ppat_any
Class signature
val class_signature :
+ self:Astlib.Ast_500.Parsetree.core_type ->
+ fields:Astlib.Ast_500.Parsetree.class_type_field list ->
+ Astlib.Ast_500.Parsetree.class_signatureclass_signature constructs an Ast.class_signature
Example OCaml
Values of type class_signature represents:
object('selfpat) ... endobject ... end when pcsig_self is Ptyp_any
Class field
val pcf_extension :
+ loc:Location.t ->
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.class_fieldval pcf_attribute :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.attribute ->
+ Astlib.Ast_500.Parsetree.class_fieldval pcf_initializer :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.class_fieldval pcf_constraint :
+ loc:Location.t ->
+ (Astlib.Ast_500.Parsetree.core_type * Astlib.Ast_500.Parsetree.core_type) ->
+ Astlib.Ast_500.Parsetree.class_fieldval pcf_method :
+ loc:Location.t ->
+ (string Astlib.Location.loc
+ * Astlib.Ast_500.Asttypes.private_flag
+ * Astlib.Ast_500.Parsetree.class_field_kind) ->
+ Astlib.Ast_500.Parsetree.class_fieldpcf_method constructs an Ast.class_field_desc.Pcf_method
Example OCaml
val pcf_val :
+ loc:Location.t ->
+ (string Astlib.Location.loc
+ * Astlib.Ast_500.Asttypes.mutable_flag
+ * Astlib.Ast_500.Parsetree.class_field_kind) ->
+ Astlib.Ast_500.Parsetree.class_fieldpcf_val constructs an Ast.class_field_desc.Pcf_val
Example OCaml
Pcf_val(x,flag, kind) represents:
val x = E when flag is Immutable and kind is Cfk_concrete(Fresh, E)val virtual x: T when flag is Immutable and kind is Cfk_virtual(T)val mutable x = E when flag is Mutable and kind is Cfk_concrete(Fresh, E)val mutable virtual x: T when flag is Mutable and kind is Cfk_virtual(T)
val pcf_inherit :
+ loc:Location.t ->
+ Astlib.Ast_500.Asttypes.override_flag ->
+ Astlib.Ast_500.Parsetree.class_expr ->
+ string Astlib.Location.loc option ->
+ Astlib.Ast_500.Parsetree.class_fieldpcf_inherit constructs an Ast.class_field_desc.Pcf_inherit
Example OCaml
Pcf_inherit(flag, CE, s) represents:
Class expr
val pcl_open :
+ loc:Location.t ->
+ Astlib.Longident.t Astlib.Location.loc Astlib.Ast_500.Parsetree.open_infos ->
+ Astlib.Ast_500.Parsetree.class_expr ->
+ Astlib.Ast_500.Parsetree.class_exprval pcl_extension :
+ loc:Location.t ->
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.class_exprval pcl_constraint :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.class_expr ->
+ Astlib.Ast_500.Parsetree.class_type ->
+ Astlib.Ast_500.Parsetree.class_exprval pcl_let :
+ loc:Location.t ->
+ Astlib.Ast_500.Asttypes.rec_flag ->
+ Astlib.Ast_500.Parsetree.value_binding list ->
+ Astlib.Ast_500.Parsetree.class_expr ->
+ Astlib.Ast_500.Parsetree.class_exprpcl_let constructs an Ast.class_expr_desc.Pcl_let
Example OCaml
Pcl_let(rec, [(P1, E1); ... ; (Pn, En)], CE) represents:
let P1 = E1 and ... and Pn = EN in CE when rec is Nonrecursive,let rec P1 = E1 and ... and Pn = EN in CE when rec is Recursive.
val pcl_apply :
+ loc: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_exprpcl_apply constructs an Ast.class_expr_desc.Pcl_apply
Example OCaml
Pcl_apply(CE, [(l1,E1) ; ... ; (ln,En)]) represents CE ~l1:E1 ... ~ln:En. li can be empty (non labeled argument) or start with ? (optional argument).
Invariant: n > 0
val pcl_fun :
+ loc:Location.t ->
+ Astlib.Ast_500.Asttypes.arg_label ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.class_expr ->
+ Astlib.Ast_500.Parsetree.class_exprpcl_fun constructs an Ast.class_expr_desc.Pcl_fun
Example OCaml
Pcl_fun(lbl, exp0, P, CE) represents:
fun P -> CE when lbl is Nolabel and exp0 is None,fun ~l:P -> CE when lbl is Labelled l and exp0 is None,fun ?l:P -> CE when lbl is Optional l and exp0 is None,fun ?l:(P = E0) -> CE when lbl is Optional l and exp0 is Some E0.
val pcl_structure :
+ loc:Location.t ->
+ Astlib.Ast_500.Parsetree.class_structure ->
+ Astlib.Ast_500.Parsetree.class_exprval pcl_constr :
+ loc:Location.t ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.class_exprCase
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.caseBinding op
val binding_op :
+ loc:Location.t ->
+ op:string Astlib.Location.loc ->
+ pat:Astlib.Ast_500.Parsetree.pattern ->
+ exp:Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.binding_opbinding_op constructs an Ast.binding_op
Attribute
val attribute :
+ loc:Location.t ->
+ name:string Astlib.Location.loc ->
+ payload:Astlib.Ast_500.Parsetree.payload ->
+ Astlib.Ast_500.Parsetree.attributeattribute constructs an Ast.attribute
Example OCaml
Attributes such as [@id ARG] and [@@id ARG].
Metadata containers passed around within the AST. The compiler ignores unknown attributes.
'a open infos
val open_infos :
+ loc:Location.t ->
+ expr:'a ->
+ override:Astlib.Ast_500.Asttypes.override_flag ->
+ 'a Astlib.Ast_500.Parsetree.open_infosopen_infos constructs an Ast.'aopen_infos
Example OCaml
Values of type 'a open_infos represents:
open! X when popen_override is Override (silences the "used identifier shadowing" warning)open X when popen_override is Fresh
'a include infos
val include_infos :
+ loc:Location.t ->
+ 'a ->
+ 'a Astlib.Ast_500.Parsetree.include_infosinclude_infos constructs an Ast.'ainclude_infos
'a class infos
val class_infos :
+ loc: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 ->
- constructors:Astlib.Ast_500.Parsetree.extension_constructor list ->
- private_:Astlib.Ast_500.Asttypes.private_flag ->
- Astlib.Ast_500.Parsetree.type_extensionval value_binding :
- loc:Astlib.Location.t ->
- pat:Astlib.Ast_500.Parsetree.pattern ->
- expr:Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.value_bindingval 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_descriptionmodule Latest : sig ... endThis 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 :
+ expr:'a ->
+ 'a Astlib.Ast_500.Parsetree.class_infosclass_infos constructs an Ast.'aclass_infos
Example OCaml
Values of type class_expr class_infos represents:
class c = ...class ['a1,...,'an] c = ...class virtual c = ...
They are also used for "class type" declaration.
module Latest : sig ... endThis 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 ->
diff --git a/ppxlib/Ppxlib/Ast_builder/Make/index.html b/ppxlib/Ppxlib/Ast_builder/Make/index.html
index 37b7ec0..ad22dd7 100644
--- a/ppxlib/Ppxlib/Ast_builder/Make/index.html
+++ b/ppxlib/Ppxlib/Ast_builder/Make/index.html
@@ -1,440 +1,22 @@
-Make (ppxlib.Ppxlib.Ast_builder.Make) Module Ast_builder.Make
Build Ast helpers with the location argument factorized.
Parameters
Signature
module Located : sig ... endinclude sig ... end
val loc : Location.tval attribute :
+Make (ppxlib.Ppxlib.Ast_builder.Make) Module Ast_builder.Make
Build Ast helpers with the location argument factorized.
Parameters
Signature
module Located : sig ... endval loc : Location.tValue description
val value_description :
name:string Astlib.Location.loc ->
- payload:Astlib.Ast_500.Parsetree.payload ->
- Astlib.Ast_500.Parsetree.attributeval binding_op :
- op:string Astlib.Location.loc ->
+ type_:Astlib.Ast_500.Parsetree.core_type ->
+ prim:string list ->
+ Astlib.Ast_500.Parsetree.value_descriptionvalue_description constructs an Ast.value_description
Example OCaml
Values of type value_description represents:
Value binding
val value_binding :
pat:Astlib.Ast_500.Parsetree.pattern ->
- exp:Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.binding_opval case :
- lhs:Astlib.Ast_500.Parsetree.pattern ->
- guard:Astlib.Ast_500.Parsetree.expression option ->
- rhs:Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.caseval pcl_constr :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.class_exprval pcl_structure :
- Astlib.Ast_500.Parsetree.class_structure ->
- Astlib.Ast_500.Parsetree.class_exprval pcl_fun :
- Astlib.Ast_500.Asttypes.arg_label ->
- Astlib.Ast_500.Parsetree.expression option ->
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.class_expr ->
- Astlib.Ast_500.Parsetree.class_exprval pcl_apply :
- Astlib.Ast_500.Parsetree.class_expr ->
- (Astlib.Ast_500.Asttypes.arg_label * Astlib.Ast_500.Parsetree.expression)
- list ->
- Astlib.Ast_500.Parsetree.class_exprval pcl_let :
- Astlib.Ast_500.Asttypes.rec_flag ->
- Astlib.Ast_500.Parsetree.value_binding list ->
- Astlib.Ast_500.Parsetree.class_expr ->
- Astlib.Ast_500.Parsetree.class_exprval pcl_constraint :
- Astlib.Ast_500.Parsetree.class_expr ->
- Astlib.Ast_500.Parsetree.class_type ->
- Astlib.Ast_500.Parsetree.class_exprval pcl_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.class_exprval pcf_inherit :
- Astlib.Ast_500.Asttypes.override_flag ->
- Astlib.Ast_500.Parsetree.class_expr ->
- string Astlib.Location.loc option ->
- Astlib.Ast_500.Parsetree.class_fieldval pcf_val :
- (string Astlib.Location.loc
- * Astlib.Ast_500.Asttypes.mutable_flag
- * Astlib.Ast_500.Parsetree.class_field_kind) ->
- Astlib.Ast_500.Parsetree.class_fieldval pcf_method :
- (string Astlib.Location.loc
- * Astlib.Ast_500.Asttypes.private_flag
- * Astlib.Ast_500.Parsetree.class_field_kind) ->
- Astlib.Ast_500.Parsetree.class_fieldval pcf_constraint :
- (Astlib.Ast_500.Parsetree.core_type * Astlib.Ast_500.Parsetree.core_type) ->
- Astlib.Ast_500.Parsetree.class_fieldval pcf_initializer :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.class_fieldval pcf_attribute :
- Astlib.Ast_500.Parsetree.attribute ->
- Astlib.Ast_500.Parsetree.class_fieldval pcf_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.class_fieldval class_infos :
- virt:Astlib.Ast_500.Asttypes.virtual_flag ->
+ expr:Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.value_bindingvalue_binding constructs an Ast.value_binding
Type extension
val type_extension :
+ 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 ->
- name:string Astlib.Location.loc ->
- expr:'a ->
- 'a Astlib.Ast_500.Parsetree.class_infosval class_signature :
- self:Astlib.Ast_500.Parsetree.core_type ->
- fields:Astlib.Ast_500.Parsetree.class_type_field list ->
- Astlib.Ast_500.Parsetree.class_signatureval class_structure :
- self:Astlib.Ast_500.Parsetree.pattern ->
- fields:Astlib.Ast_500.Parsetree.class_field list ->
- Astlib.Ast_500.Parsetree.class_structureval pcty_constr :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.class_typeval pcty_signature :
- Astlib.Ast_500.Parsetree.class_signature ->
- Astlib.Ast_500.Parsetree.class_typeval pcty_arrow :
- Astlib.Ast_500.Asttypes.arg_label ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.class_type ->
- Astlib.Ast_500.Parsetree.class_typeval pcty_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.class_typeval pctf_inherit :
- Astlib.Ast_500.Parsetree.class_type ->
- Astlib.Ast_500.Parsetree.class_type_fieldval pctf_val :
- (string Astlib.Location.loc
- * Astlib.Ast_500.Asttypes.mutable_flag
- * Astlib.Ast_500.Asttypes.virtual_flag
- * Astlib.Ast_500.Parsetree.core_type) ->
- Astlib.Ast_500.Parsetree.class_type_fieldval pctf_method :
- (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_fieldval pctf_constraint :
- (Astlib.Ast_500.Parsetree.core_type * Astlib.Ast_500.Parsetree.core_type) ->
- Astlib.Ast_500.Parsetree.class_type_fieldval pctf_attribute :
- Astlib.Ast_500.Parsetree.attribute ->
- Astlib.Ast_500.Parsetree.class_type_fieldval pctf_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.class_type_fieldval ptyp_any : Astlib.Ast_500.Parsetree.core_typeval ptyp_var : string -> Astlib.Ast_500.Parsetree.core_typeval ptyp_arrow :
- Astlib.Ast_500.Asttypes.arg_label ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_tuple :
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_constr :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_object :
- Astlib.Ast_500.Parsetree.object_field list ->
- Astlib.Ast_500.Asttypes.closed_flag ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_class :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_alias :
- Astlib.Ast_500.Parsetree.core_type ->
- string ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_variant :
- Astlib.Ast_500.Parsetree.row_field list ->
- Astlib.Ast_500.Asttypes.closed_flag ->
- string list option ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_poly :
- string Astlib.Location.loc list ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_package :
- (Astlib.Longident.t Astlib.Location.loc
- * (Astlib.Longident.t Astlib.Location.loc
- * Astlib.Ast_500.Parsetree.core_type)
- list) ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.core_typeval pdir_string : string -> Astlib.Ast_500.Parsetree.directive_argumentval pdir_int :
- string ->
- char option ->
- Astlib.Ast_500.Parsetree.directive_argumentval pdir_ident :
- Astlib.Longident.t ->
- Astlib.Ast_500.Parsetree.directive_argumentval pdir_bool : bool -> Astlib.Ast_500.Parsetree.directive_argumentval pexp_ident :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expressionval pexp_constant :
- Astlib.Ast_500.Parsetree.constant ->
- Astlib.Ast_500.Parsetree.expressionval pexp_let :
- Astlib.Ast_500.Asttypes.rec_flag ->
- Astlib.Ast_500.Parsetree.value_binding list ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_function :
- Astlib.Ast_500.Parsetree.case list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_fun :
- Astlib.Ast_500.Asttypes.arg_label ->
- Astlib.Ast_500.Parsetree.expression option ->
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_apply :
- Astlib.Ast_500.Parsetree.expression ->
- (Astlib.Ast_500.Asttypes.arg_label * Astlib.Ast_500.Parsetree.expression)
- list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_match :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.case list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_try :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.case list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_tuple :
- Astlib.Ast_500.Parsetree.expression list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_construct :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expression option ->
- Astlib.Ast_500.Parsetree.expressionval pexp_variant :
- string ->
- Astlib.Ast_500.Parsetree.expression option ->
- Astlib.Ast_500.Parsetree.expressionval pexp_record :
- (Astlib.Longident.t Astlib.Location.loc * Astlib.Ast_500.Parsetree.expression)
- list ->
- Astlib.Ast_500.Parsetree.expression option ->
- Astlib.Ast_500.Parsetree.expressionval pexp_field :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expressionval pexp_setfield :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_array :
- Astlib.Ast_500.Parsetree.expression list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_ifthenelse :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expression option ->
- Astlib.Ast_500.Parsetree.expressionval pexp_sequence :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_while :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_constraint :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.expressionval pexp_coerce :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.core_type option ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.expressionval pexp_send :
- Astlib.Ast_500.Parsetree.expression ->
- string Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expressionval pexp_new :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expressionval pexp_setinstvar :
- string Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_override :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.expression) list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_letmodule :
- string option Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_letexception :
+ constructors:Astlib.Ast_500.Parsetree.extension_constructor list ->
+ private_:Astlib.Ast_500.Asttypes.private_flag ->
+ Astlib.Ast_500.Parsetree.type_extensiontype_extension constructs an Ast.type_extension
Example OCaml
Definition of new extensions constructors for the extensive sum type t (type t += ...).
Type exception
val type_exception :
Astlib.Ast_500.Parsetree.extension_constructor ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_assert :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_lazy :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_poly :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.core_type option ->
- Astlib.Ast_500.Parsetree.expressionval pexp_object :
- Astlib.Ast_500.Parsetree.class_structure ->
- Astlib.Ast_500.Parsetree.expressionval pexp_newtype :
- string Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_pack :
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.expressionval pexp_letop :
- Astlib.Ast_500.Parsetree.letop ->
- Astlib.Ast_500.Parsetree.expressionval pexp_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.expressionval pexp_unreachable : Astlib.Ast_500.Parsetree.expressionval extension_constructor :
- name:string Astlib.Location.loc ->
- kind:Astlib.Ast_500.Parsetree.extension_constructor_kind ->
- Astlib.Ast_500.Parsetree.extension_constructorval include_infos : 'a -> 'a Astlib.Ast_500.Parsetree.include_infosval label_declaration :
- name:string Astlib.Location.loc ->
- mutable_:Astlib.Ast_500.Asttypes.mutable_flag ->
- type_:Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.label_declarationval 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.letopval location :
- start:Stdlib.Lexing.position ->
- end_:Stdlib.Lexing.position ->
- ghost:bool ->
- Astlib.Location.tval module_binding :
- name:string option Astlib.Location.loc ->
- expr:Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_bindingval module_declaration :
- name:string option Astlib.Location.loc ->
- type_:Astlib.Ast_500.Parsetree.module_type ->
- Astlib.Ast_500.Parsetree.module_declarationval pmod_ident :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_structure :
- Astlib.Ast_500.Parsetree.structure_item list ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_functor :
- Astlib.Ast_500.Parsetree.functor_parameter ->
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_apply :
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_constraint :
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_type ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_unpack :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.module_exprval module_substitution :
- name:string Astlib.Location.loc ->
- manifest:Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.module_substitutionval pmty_ident :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_signature :
- Astlib.Ast_500.Parsetree.signature_item list ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_functor :
- Astlib.Ast_500.Parsetree.functor_parameter ->
- Astlib.Ast_500.Parsetree.module_type ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_with :
- Astlib.Ast_500.Parsetree.module_type ->
- Astlib.Ast_500.Parsetree.with_constraint list ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_typeof :
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_alias :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.module_typeval module_type_declaration :
- name:string Astlib.Location.loc ->
- type_:Astlib.Ast_500.Parsetree.module_type option ->
- Astlib.Ast_500.Parsetree.module_type_declarationval otag :
- string Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.object_fieldval oinherit :
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.object_fieldval open_infos :
- expr:'a ->
- override:Astlib.Ast_500.Asttypes.override_flag ->
- 'a Astlib.Ast_500.Parsetree.open_infosval ppat_any : Astlib.Ast_500.Parsetree.patternval ppat_var : string Astlib.Location.loc -> Astlib.Ast_500.Parsetree.patternval ppat_alias :
- Astlib.Ast_500.Parsetree.pattern ->
- string Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.patternval ppat_constant :
- Astlib.Ast_500.Parsetree.constant ->
- Astlib.Ast_500.Parsetree.patternval ppat_interval :
- Astlib.Ast_500.Parsetree.constant ->
- Astlib.Ast_500.Parsetree.constant ->
- Astlib.Ast_500.Parsetree.patternval ppat_tuple :
- Astlib.Ast_500.Parsetree.pattern list ->
- Astlib.Ast_500.Parsetree.patternval ppat_variant :
- string ->
- Astlib.Ast_500.Parsetree.pattern option ->
- Astlib.Ast_500.Parsetree.patternval ppat_record :
- (Astlib.Longident.t Astlib.Location.loc * Astlib.Ast_500.Parsetree.pattern)
- list ->
- Astlib.Ast_500.Asttypes.closed_flag ->
- Astlib.Ast_500.Parsetree.patternval ppat_array :
- Astlib.Ast_500.Parsetree.pattern list ->
- Astlib.Ast_500.Parsetree.patternval ppat_or :
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.patternval ppat_constraint :
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.patternval ppat_type :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.patternval ppat_lazy :
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.patternval ppat_unpack :
- string option Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.patternval ppat_exception :
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.patternval ppat_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.patternval ppat_open :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.patternval position :
- fname:string ->
- lnum:int ->
- bol:int ->
- cnum:int ->
- Stdlib.Lexing.positionval rtag :
- string Astlib.Location.loc ->
- bool ->
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.row_fieldval rinherit :
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.row_fieldval psig_value :
- Astlib.Ast_500.Parsetree.value_description ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_type :
- Astlib.Ast_500.Asttypes.rec_flag ->
- Astlib.Ast_500.Parsetree.type_declaration list ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_typesubst :
- Astlib.Ast_500.Parsetree.type_declaration list ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_typext :
- Astlib.Ast_500.Parsetree.type_extension ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_exception :
- Astlib.Ast_500.Parsetree.type_exception ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_module :
- Astlib.Ast_500.Parsetree.module_declaration ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_modsubst :
- Astlib.Ast_500.Parsetree.module_substitution ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_recmodule :
- Astlib.Ast_500.Parsetree.module_declaration list ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_modtype :
- Astlib.Ast_500.Parsetree.module_type_declaration ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_modtypesubst :
- Astlib.Ast_500.Parsetree.module_type_declaration ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_class :
- Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_class_type :
- Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_attribute :
- Astlib.Ast_500.Parsetree.attribute ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.attribute list ->
- Astlib.Ast_500.Parsetree.signature_itemval pstr_eval :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.attribute list ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_value :
- Astlib.Ast_500.Asttypes.rec_flag ->
- Astlib.Ast_500.Parsetree.value_binding list ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_primitive :
- Astlib.Ast_500.Parsetree.value_description ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_type :
- Astlib.Ast_500.Asttypes.rec_flag ->
- Astlib.Ast_500.Parsetree.type_declaration list ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_typext :
- Astlib.Ast_500.Parsetree.type_extension ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_exception :
- Astlib.Ast_500.Parsetree.type_exception ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_module :
- Astlib.Ast_500.Parsetree.module_binding ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_recmodule :
- Astlib.Ast_500.Parsetree.module_binding list ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_modtype :
- Astlib.Ast_500.Parsetree.module_type_declaration ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_class :
- Astlib.Ast_500.Parsetree.class_expr Astlib.Ast_500.Parsetree.class_infos list ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_class_type :
- Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_attribute :
- Astlib.Ast_500.Parsetree.attribute ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.attribute list ->
- Astlib.Ast_500.Parsetree.structure_itemval toplevel_directive :
- name:string Astlib.Location.loc ->
- arg:Astlib.Ast_500.Parsetree.directive_argument option ->
- Astlib.Ast_500.Parsetree.toplevel_directiveval type_declaration :
+ Astlib.Ast_500.Parsetree.type_exceptiontype_exception constructs an Ast.type_exception
Example OCaml
Definition of a new exception (exception E).
Type declaration
val type_declaration :
name:string Astlib.Location.loc ->
params:
(Astlib.Ast_500.Parsetree.core_type
@@ -448,24 +30,442 @@
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_declarationval type_exception :
+ Astlib.Ast_500.Parsetree.type_declarationtype_declaration constructs an Ast.type_declaration
Example OCaml
Here are type declarations and their representation, for various ptype_kind and ptype_manifest values:
type t when type_kind is Ptype_abstract, and manifest is None,type t = T0 when type_kind is Ptype_abstract, and manifest is Some T0,type t = C of T | ... when type_kind is Ptype_variant, and manifest is None,type t = T0 = C of T | ... when type_kind is Ptype_variant, and manifest is Some T0,type t = {l: T; ...} when type_kind is Ptype_record, and manifest is None,type t = T0 = {l : T; ...} when type_kind is Ptype_record, and manifest is Some T0,type t = .. when type_kind is Ptype_open, and manifest is None.
Toplevel directive
val toplevel_directive :
+ name:string Astlib.Location.loc ->
+ arg:Astlib.Ast_500.Parsetree.directive_argument option ->
+ Astlib.Ast_500.Parsetree.toplevel_directivetoplevel_directive constructs an Ast.toplevel_directive
Structure item
val pstr_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.attribute list ->
+ Astlib.Ast_500.Parsetree.structure_itemval pstr_attribute :
+ Astlib.Ast_500.Parsetree.attribute ->
+ Astlib.Ast_500.Parsetree.structure_itemval pstr_class_type :
+ Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_class_type constructs an Ast.structure_item_desc.Pstr_class_type
Example OCaml
class type ct1 = ... and ... and ctn = ...
val pstr_class :
+ Astlib.Ast_500.Parsetree.class_expr Astlib.Ast_500.Parsetree.class_infos list ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_class constructs an Ast.structure_item_desc.Pstr_class
Example OCaml
class c1 = ... and ... and cn = ...
val pstr_modtype :
+ Astlib.Ast_500.Parsetree.module_type_declaration ->
+ Astlib.Ast_500.Parsetree.structure_itemval pstr_recmodule :
+ Astlib.Ast_500.Parsetree.module_binding list ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_recmodule constructs an Ast.structure_item_desc.Pstr_recmodule
Example OCaml
module rec X1 = ME1 and ... and Xn = MEn
val pstr_module :
+ Astlib.Ast_500.Parsetree.module_binding ->
+ Astlib.Ast_500.Parsetree.structure_itemval pstr_exception :
+ Astlib.Ast_500.Parsetree.type_exception ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_exception constructs an Ast.structure_item_desc.Pstr_exception
Example OCaml
exception C of Texception C = M.X
val pstr_typext :
+ Astlib.Ast_500.Parsetree.type_extension ->
+ Astlib.Ast_500.Parsetree.structure_itemval pstr_type :
+ Astlib.Ast_500.Asttypes.rec_flag ->
+ Astlib.Ast_500.Parsetree.type_declaration list ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_type constructs an Ast.structure_item_desc.Pstr_type
Example OCaml
type t1 = ... and ... and tn = ...
val pstr_primitive :
+ Astlib.Ast_500.Parsetree.value_description ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_primitive constructs an Ast.structure_item_desc.Pstr_primitive
Example OCaml
val x: Texternal x: T = "s1" ... "sn"
val pstr_value :
+ Astlib.Ast_500.Asttypes.rec_flag ->
+ Astlib.Ast_500.Parsetree.value_binding list ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_value constructs an Ast.structure_item_desc.Pstr_value
Example OCaml
Pstr_value(rec, [(P1, E1 ; ... ; (Pn, En))]) represents:
let P1 = E1 and ... and Pn = EN when rec is Nonrecursive,let rec P1 = E1 and ... and Pn = EN when rec is Recursive.
val pstr_eval :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.attribute list ->
+ Astlib.Ast_500.Parsetree.structure_itemSignature item
val psig_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.attribute list ->
+ Astlib.Ast_500.Parsetree.signature_itemval psig_attribute :
+ Astlib.Ast_500.Parsetree.attribute ->
+ Astlib.Ast_500.Parsetree.signature_itemval psig_class_type :
+ Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_class_type constructs an Ast.signature_item_desc.Psig_class_type
Example OCaml
class type ct1 = ... and ... and ctn = ...
val psig_class :
+ Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_class constructs an Ast.signature_item_desc.Psig_class
Example OCaml
class c1 : ... and ... and cn : ...
val psig_modtypesubst :
+ Astlib.Ast_500.Parsetree.module_type_declaration ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_modtypesubst constructs an Ast.signature_item_desc.Psig_modtypesubst
Example OCaml
module type S := ...
val psig_modtype :
+ Astlib.Ast_500.Parsetree.module_type_declaration ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_modtype constructs an Ast.signature_item_desc.Psig_modtype
Example OCaml
module type S = MT and module type S
val psig_recmodule :
+ Astlib.Ast_500.Parsetree.module_declaration list ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_recmodule constructs an Ast.signature_item_desc.Psig_recmodule
Example OCaml
module rec X1 : MT1 and ... and Xn : MTn
val psig_modsubst :
+ Astlib.Ast_500.Parsetree.module_substitution ->
+ Astlib.Ast_500.Parsetree.signature_itemval psig_module :
+ Astlib.Ast_500.Parsetree.module_declaration ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_module constructs an Ast.signature_item_desc.Psig_module
Example OCaml
module X = M and module X : MT
val psig_exception :
+ Astlib.Ast_500.Parsetree.type_exception ->
+ Astlib.Ast_500.Parsetree.signature_itemval psig_typext :
+ Astlib.Ast_500.Parsetree.type_extension ->
+ Astlib.Ast_500.Parsetree.signature_itemval psig_typesubst :
+ Astlib.Ast_500.Parsetree.type_declaration list ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_typesubst constructs an Ast.signature_item_desc.Psig_typesubst
Example OCaml
type t1 := ... and ... and tn := ...
val psig_type :
+ Astlib.Ast_500.Asttypes.rec_flag ->
+ Astlib.Ast_500.Parsetree.type_declaration list ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_type constructs an Ast.signature_item_desc.Psig_type
Example OCaml
type t1 = ... and ... and tn = ...
val psig_value :
+ Astlib.Ast_500.Parsetree.value_description ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_value constructs an Ast.signature_item_desc.Psig_value
Example OCaml
val x: Texternal x: T = "s1" ... "sn"
Row field
val rinherit :
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.row_fieldval rtag :
+ string Astlib.Location.loc ->
+ bool ->
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.row_fieldrtag constructs an Ast.row_field_desc.Rtag
Example OCaml
Rtag(`A, b, l) represents:
`A when b is true and l is [],`A of T when b is false and l is [T],`A of T1 & .. & Tn when b is false and l is [T1;...Tn],`A of & T1 & .. & Tn when b is true and l is [T1;...Tn].
- The
bool field is true if the tag contains a constant (empty) constructor. & occurs when several types are used for the same constructor (see 4.2 in the manual)
Position
val position :
+ fname:string ->
+ lnum:int ->
+ bol:int ->
+ cnum:int ->
+ Stdlib.Lexing.positionposition constructs an Ast.position
Pattern
val ppat_open :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.patternval ppat_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.patternval ppat_exception :
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.patternval ppat_unpack :
+ string option Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.patternppat_unpack constructs an Ast.pattern_desc.Ppat_unpack
Example OCaml
Ppat_unpack(s) represents:
(module P) when s is Some "P"(module _) when s is None
Note: (module P : S) is represented as Ppat_constraint(Ppat_unpack(Some "P"), Ptyp_package S)
val ppat_lazy :
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.patternval ppat_type :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.patternval ppat_constraint :
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.patternval ppat_or :
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.patternval ppat_array :
+ Astlib.Ast_500.Parsetree.pattern list ->
+ Astlib.Ast_500.Parsetree.patternval ppat_record :
+ (Astlib.Longident.t Astlib.Location.loc * Astlib.Ast_500.Parsetree.pattern)
+ list ->
+ Astlib.Ast_500.Asttypes.closed_flag ->
+ Astlib.Ast_500.Parsetree.patternppat_record constructs an Ast.pattern_desc.Ppat_record
Example OCaml
Ppat_record([(l1, P1) ; ... ; (ln, Pn)], flag) represents:
Invariant: n > 0
val ppat_variant :
+ string ->
+ Astlib.Ast_500.Parsetree.pattern option ->
+ Astlib.Ast_500.Parsetree.patternppat_variant constructs an Ast.pattern_desc.Ppat_variant
Example OCaml
Ppat_variant(`A, pat) represents:
`A when pat is None,`A P when pat is Some P
val ppat_tuple :
+ Astlib.Ast_500.Parsetree.pattern list ->
+ Astlib.Ast_500.Parsetree.patternppat_tuple constructs an Ast.pattern_desc.Ppat_tuple
Example OCaml
Patterns (P1, ..., Pn).
Invariant: n >= 2
val ppat_interval :
+ Astlib.Ast_500.Parsetree.constant ->
+ Astlib.Ast_500.Parsetree.constant ->
+ Astlib.Ast_500.Parsetree.patternppat_interval constructs an Ast.pattern_desc.Ppat_interval
Example OCaml
Patterns such as 'a'..'z'.
Other forms of interval are recognized by the parser but rejected by the type-checker.
val ppat_constant :
+ Astlib.Ast_500.Parsetree.constant ->
+ Astlib.Ast_500.Parsetree.patternppat_constant constructs an Ast.pattern_desc.Ppat_constant
Example OCaml
Patterns such as 1, 'a', "true", 1.0, 1l, 1L, 1n
val ppat_alias :
+ Astlib.Ast_500.Parsetree.pattern ->
+ string Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.patternval ppat_var : string Astlib.Location.loc -> Astlib.Ast_500.Parsetree.patternval ppat_any : Astlib.Ast_500.Parsetree.patternObject field
val oinherit :
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.object_fieldoinherit constructs an Ast.object_field_desc.Oinherit
val otag :
+ string Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.object_fieldotag constructs an Ast.object_field_desc.Otag
Module type declaration
val module_type_declaration :
+ name:string Astlib.Location.loc ->
+ type_:Astlib.Ast_500.Parsetree.module_type option ->
+ Astlib.Ast_500.Parsetree.module_type_declarationmodule_type_declaration constructs an Ast.module_type_declaration
Example OCaml
Values of type module_type_declaration represents:
S = MT,S for abstract module type declaration, when pmtd_type is None.
Module type
val pmty_alias :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_typeof :
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_with :
+ Astlib.Ast_500.Parsetree.module_type ->
+ Astlib.Ast_500.Parsetree.with_constraint list ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_functor :
+ Astlib.Ast_500.Parsetree.functor_parameter ->
+ Astlib.Ast_500.Parsetree.module_type ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_signature :
+ Astlib.Ast_500.Parsetree.signature_item list ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_ident :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.module_typeModule substitution
val module_substitution :
+ name:string Astlib.Location.loc ->
+ manifest:Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.module_substitutionmodule_substitution constructs an Ast.module_substitution
Example OCaml
Values of type module_substitution represents S := M
Module expr
val pmod_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_unpack :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_constraint :
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_type ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_apply :
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_functor :
+ Astlib.Ast_500.Parsetree.functor_parameter ->
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_structure :
+ Astlib.Ast_500.Parsetree.structure_item list ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_ident :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.module_exprModule declaration
val module_declaration :
+ name:string option Astlib.Location.loc ->
+ type_:Astlib.Ast_500.Parsetree.module_type ->
+ Astlib.Ast_500.Parsetree.module_declarationmodule_declaration constructs an Ast.module_declaration
Example OCaml
Values of type module_declaration represents S : MT
Module binding
val module_binding :
+ name:string option Astlib.Location.loc ->
+ expr:Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_bindingmodule_binding constructs an Ast.module_binding
Example OCaml
Values of type module_binding represents module X = ME
Location
val location :
+ start:Stdlib.Lexing.position ->
+ end_:Stdlib.Lexing.position ->
+ ghost:bool ->
+ Astlib.Location.tlocation constructs an Ast.location
Letop
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.letopletop constructs an Ast.letop
Label declaration
val label_declaration :
+ name:string Astlib.Location.loc ->
+ mutable_:Astlib.Ast_500.Asttypes.mutable_flag ->
+ type_:Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.label_declarationlabel_declaration constructs an Ast.label_declaration
Example OCaml
{ ...; l: T; ... } when pld_mutable is Immutable,{ ...; mutable l: T; ... } when pld_mutable is Mutable.
Note: T can be a Ptyp_poly.
Extension constructor
val extension_constructor :
+ name:string Astlib.Location.loc ->
+ kind:Astlib.Ast_500.Parsetree.extension_constructor_kind ->
+ Astlib.Ast_500.Parsetree.extension_constructorextension_constructor constructs an Ast.extension_constructor
Expression
val pexp_unreachable : Astlib.Ast_500.Parsetree.expressionval pexp_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_letop :
+ Astlib.Ast_500.Parsetree.letop ->
+ Astlib.Ast_500.Parsetree.expressionpexp_letop constructs an Ast.expression_desc.Pexp_letop
Example OCaml
let* P = E0 in E1let* P0 = E00 and* P1 = E01 in E1
val pexp_open :
+ Astlib.Ast_500.Parsetree.module_expr Astlib.Ast_500.Parsetree.open_infos ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_open constructs an Ast.expression_desc.Pexp_open
Example OCaml
M.(E)let open M in Elet open! M in E
val pexp_pack :
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.expressionpexp_pack constructs an Ast.expression_desc.Pexp_pack
Example OCaml
(module ME).
(module ME : S) is represented as Pexp_constraint(Pexp_pack ME, Ptyp_package S)
val pexp_newtype :
+ string Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_object :
+ Astlib.Ast_500.Parsetree.class_structure ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_poly :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.core_type option ->
+ Astlib.Ast_500.Parsetree.expressionpexp_poly constructs an Ast.expression_desc.Pexp_poly
Example OCaml
Used for method bodies.
Can only be used as the expression under Cfk_concrete for methods (not values).
val pexp_lazy :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_assert :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_assert constructs an Ast.expression_desc.Pexp_assert
Example OCaml
assert E.
Note: assert false is treated in a special way by the type-checker.
val pexp_letexception :
Astlib.Ast_500.Parsetree.extension_constructor ->
- Astlib.Ast_500.Parsetree.type_exceptionval type_extension :
- path:Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_letexception constructs an Ast.expression_desc.Pexp_letexception
Example OCaml
let exception C in E
val pexp_letmodule :
+ string option Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_override :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.expression) list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_override constructs an Ast.expression_desc.Pexp_override
Example OCaml
{< x1 = E1; ...; xn = En >}
val pexp_setinstvar :
+ string Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_new :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_send :
+ Astlib.Ast_500.Parsetree.expression ->
+ string Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_coerce :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.core_type option ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.expressionpexp_coerce constructs an Ast.expression_desc.Pexp_coerce
Example OCaml
Pexp_coerce(E, from, T) represents
(E :> T) when from is None,(E : T0 :> T) when from is Some T0.
val pexp_constraint :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_for :
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Asttypes.direction_flag ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_for constructs an Ast.expression_desc.Pexp_for
Example OCaml
Pexp_for(i, E1, E2, direction, E3) represents:
val pexp_while :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_sequence :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_ifthenelse :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_array :
+ Astlib.Ast_500.Parsetree.expression list ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_setfield :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_field :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_record :
+ (Astlib.Longident.t Astlib.Location.loc * Astlib.Ast_500.Parsetree.expression)
+ list ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.expressionpexp_record constructs an Ast.expression_desc.Pexp_record
Example OCaml
Pexp_record([(l1,P1) ; ... ; (ln,Pn)], exp0) represents
{ l1=P1; ...; ln=Pn } when exp0 is None{ E0 with l1=P1; ...; ln=Pn } when exp0 is Some E0
Invariant: n > 0
val pexp_variant :
+ string ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.expressionpexp_variant constructs an Ast.expression_desc.Pexp_variant
Example OCaml
Pexp_variant(`A, exp) represents
`A when exp is None`A E when exp is Some E
val pexp_construct :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.expressionpexp_construct constructs an Ast.expression_desc.Pexp_construct
Example OCaml
Pexp_construct(C, exp) represents:
C when exp is None,C E when exp is Some E,C (E1, ..., En) when exp is Some (Pexp_tuple[E1;...;En])
val pexp_tuple :
+ Astlib.Ast_500.Parsetree.expression list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_tuple constructs an Ast.expression_desc.Pexp_tuple
Example OCaml
Expressions (E1, ..., En)
Invariant: n >= 2
val pexp_try :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.case list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_try constructs an Ast.expression_desc.Pexp_try
Example OCaml
try E0 with P1 -> E1 | ... | Pn -> En
val pexp_match :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.case list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_match constructs an Ast.expression_desc.Pexp_match
Example OCaml
match E0 with P1 -> E1 | ... | Pn -> En
val pexp_apply :
+ Astlib.Ast_500.Parsetree.expression ->
+ (Astlib.Ast_500.Asttypes.arg_label * Astlib.Ast_500.Parsetree.expression)
+ list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_apply constructs an Ast.expression_desc.Pexp_apply
Example OCaml
Pexp_apply(E0, [(l1, E1) ; ... ; (ln, En)]) represents E0 ~l1:E1 ... ~ln:En
li can be Nolabel (non labeled argument), Labelled (labelled arguments) or Optional (optional argument).
Invariant: n > 0
val pexp_fun :
+ Astlib.Ast_500.Asttypes.arg_label ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_fun constructs an Ast.expression_desc.Pexp_fun
Example OCaml
Pexp_fun(lbl, exp0, P, E1) represents:
fun P -> E1 when lbl is Nolabel and exp0 is Nonefun ~l:P -> E1 when lbl is Labelled l and exp0 is Nonefun ?l:P -> E1 when lbl is Optional l and exp0 is Nonefun ?l:(P = E0) -> E1 when lbl is Optional l and exp0 is Some E0
Notes:
val pexp_function :
+ Astlib.Ast_500.Parsetree.case list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_function constructs an Ast.expression_desc.Pexp_function
Example OCaml
function P1 -> E1 | ... | Pn -> En
val pexp_let :
+ Astlib.Ast_500.Asttypes.rec_flag ->
+ Astlib.Ast_500.Parsetree.value_binding list ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_let constructs an Ast.expression_desc.Pexp_let
Example OCaml
Pexp_let(flag, [(P1,E1) ; ... ; (Pn,En)], E) represents:
let P1 = E1 and ... and Pn = EN in E when flag is Nonrecursive,let rec P1 = E1 and ... and Pn = EN in E when flag is Recursive.
val pexp_constant :
+ Astlib.Ast_500.Parsetree.constant ->
+ Astlib.Ast_500.Parsetree.expressionpexp_constant constructs an Ast.expression_desc.Pexp_constant
Example OCaml
Expressions constant such as 1, 'a', "true", 1.0, 1l, 1L, 1n
val pexp_ident :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expressionDirective argument
val pdir_bool : bool -> Astlib.Ast_500.Parsetree.directive_argumentpdir_bool constructs an Ast.directive_argument_desc.Pdir_bool
val pdir_ident :
+ Astlib.Longident.t ->
+ Astlib.Ast_500.Parsetree.directive_argumentpdir_ident constructs an Ast.directive_argument_desc.Pdir_ident
val pdir_int :
+ string ->
+ char option ->
+ Astlib.Ast_500.Parsetree.directive_argumentpdir_int constructs an Ast.directive_argument_desc.Pdir_int
val pdir_string : string -> Astlib.Ast_500.Parsetree.directive_argumentpdir_string constructs an Ast.directive_argument_desc.Pdir_string
Core type
val ptyp_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.core_typeval ptyp_package :
+ (Astlib.Longident.t Astlib.Location.loc
+ * (Astlib.Longident.t Astlib.Location.loc
+ * Astlib.Ast_500.Parsetree.core_type)
+ list) ->
+ Astlib.Ast_500.Parsetree.core_typeval ptyp_poly :
+ string Astlib.Location.loc list ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_poly constructs an Ast.core_type_desc.Ptyp_poly
Example OCaml
'a1 ... 'an. T
Can only appear in the following context:
- As the
core_type of a Ppat_constraint node corresponding to a constraint on a let-binding:
let x : 'a1 ... 'an. T = e ...
- Under
Cfk_virtual for methods (not values).
- As the
core_type of a Pctf_method node.
- As the
pld_type field of a label_declaration.
- As a
core_type of a Ptyp_object node.
- As the
pval_type field of a value_description.
val ptyp_variant :
+ Astlib.Ast_500.Parsetree.row_field list ->
+ Astlib.Ast_500.Asttypes.closed_flag ->
+ string list option ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_variant constructs an Ast.core_type_desc.Ptyp_variant
Example OCaml
Ptyp_variant([`A;`B], flag, labels) represents:
val ptyp_alias :
+ Astlib.Ast_500.Parsetree.core_type ->
+ string ->
+ Astlib.Ast_500.Parsetree.core_typeval ptyp_class :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_class constructs an Ast.core_type_desc.Ptyp_class
Example OCaml
Ptyp_class(tconstr, l) represents:
#tconstr when l=[],T #tconstr when l=[T],(T1, ..., Tn) #tconstr when l=[T1 ; ... ; Tn].
val ptyp_object :
+ Astlib.Ast_500.Parsetree.object_field list ->
+ Astlib.Ast_500.Asttypes.closed_flag ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_object constructs an Ast.core_type_desc.Ptyp_object
Example OCaml
Ptyp_object([ l1:T1; ...; ln:Tn ], flag) represents:
val ptyp_constr :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_constr constructs an Ast.core_type_desc.Ptyp_constr
Example OCaml
Ptyp_constr(lident, l) represents:
tconstr when l=[],T tconstr when l=[T],(T1, ..., Tn) tconstr when l=[T1 ; ... ; Tn].
val ptyp_tuple :
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_tuple constructs an Ast.core_type_desc.Ptyp_tuple
Example OCaml
Ptyp_tuple([T1 ; ... ; Tn]) represents a product type T1 * ... * Tn.
Invariant: n >= 2.
val ptyp_arrow :
+ Astlib.Ast_500.Asttypes.arg_label ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_arrow constructs an Ast.core_type_desc.Ptyp_arrow
Example OCaml
Ptyp_arrow(lbl, T1, T2) represents:
val ptyp_var : string -> Astlib.Ast_500.Parsetree.core_typeval ptyp_any : Astlib.Ast_500.Parsetree.core_typeConstructor declaration
Class type field
val pctf_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.class_type_fieldval pctf_attribute :
+ Astlib.Ast_500.Parsetree.attribute ->
+ Astlib.Ast_500.Parsetree.class_type_fieldval pctf_constraint :
+ (Astlib.Ast_500.Parsetree.core_type * Astlib.Ast_500.Parsetree.core_type) ->
+ Astlib.Ast_500.Parsetree.class_type_fieldpctf_constraint constructs an Ast.class_type_field_desc.Pctf_constraint
Example OCaml
constraint T1 = T2
val pctf_method :
+ (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_fieldpctf_method constructs an Ast.class_type_field_desc.Pctf_method
Example OCaml
method x: T
Note: T can be a Ptyp_poly.
val pctf_val :
+ (string Astlib.Location.loc
+ * Astlib.Ast_500.Asttypes.mutable_flag
+ * Astlib.Ast_500.Asttypes.virtual_flag
+ * Astlib.Ast_500.Parsetree.core_type) ->
+ Astlib.Ast_500.Parsetree.class_type_fieldval pctf_inherit :
+ Astlib.Ast_500.Parsetree.class_type ->
+ Astlib.Ast_500.Parsetree.class_type_fieldClass type
val pcty_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.class_typeval pcty_arrow :
+ Astlib.Ast_500.Asttypes.arg_label ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.class_type ->
+ Astlib.Ast_500.Parsetree.class_typepcty_arrow constructs an Ast.class_type_desc.Pcty_arrow
Example OCaml
Pcty_arrow(lbl, T, CT) represents:
T -> CT when lbl is Nolabel,~l:T -> CT when lbl is Labelled l,?l:T -> CT when lbl is Optional l.
val pcty_signature :
+ Astlib.Ast_500.Parsetree.class_signature ->
+ Astlib.Ast_500.Parsetree.class_typeval pcty_constr :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.class_typeClass structure
val class_structure :
+ self:Astlib.Ast_500.Parsetree.pattern ->
+ fields:Astlib.Ast_500.Parsetree.class_field list ->
+ Astlib.Ast_500.Parsetree.class_structureclass_structure constructs an Ast.class_structure
Example OCaml
Values of type class_structure represents:
object(selfpat) ... endobject ... end when pcstr_self is Ppat_any
Class signature
val class_signature :
+ self:Astlib.Ast_500.Parsetree.core_type ->
+ fields:Astlib.Ast_500.Parsetree.class_type_field list ->
+ Astlib.Ast_500.Parsetree.class_signatureclass_signature constructs an Ast.class_signature
Example OCaml
Values of type class_signature represents:
object('selfpat) ... endobject ... end when pcsig_self is Ptyp_any
Class field
val pcf_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.class_fieldval pcf_attribute :
+ Astlib.Ast_500.Parsetree.attribute ->
+ Astlib.Ast_500.Parsetree.class_fieldval pcf_initializer :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.class_fieldval pcf_constraint :
+ (Astlib.Ast_500.Parsetree.core_type * Astlib.Ast_500.Parsetree.core_type) ->
+ Astlib.Ast_500.Parsetree.class_fieldval pcf_method :
+ (string Astlib.Location.loc
+ * Astlib.Ast_500.Asttypes.private_flag
+ * Astlib.Ast_500.Parsetree.class_field_kind) ->
+ Astlib.Ast_500.Parsetree.class_fieldpcf_method constructs an Ast.class_field_desc.Pcf_method
Example OCaml
val pcf_val :
+ (string Astlib.Location.loc
+ * Astlib.Ast_500.Asttypes.mutable_flag
+ * Astlib.Ast_500.Parsetree.class_field_kind) ->
+ Astlib.Ast_500.Parsetree.class_fieldpcf_val constructs an Ast.class_field_desc.Pcf_val
Example OCaml
Pcf_val(x,flag, kind) represents:
val x = E when flag is Immutable and kind is Cfk_concrete(Fresh, E)val virtual x: T when flag is Immutable and kind is Cfk_virtual(T)val mutable x = E when flag is Mutable and kind is Cfk_concrete(Fresh, E)val mutable virtual x: T when flag is Mutable and kind is Cfk_virtual(T)
val pcf_inherit :
+ Astlib.Ast_500.Asttypes.override_flag ->
+ Astlib.Ast_500.Parsetree.class_expr ->
+ string Astlib.Location.loc option ->
+ Astlib.Ast_500.Parsetree.class_fieldpcf_inherit constructs an Ast.class_field_desc.Pcf_inherit
Example OCaml
Pcf_inherit(flag, CE, s) represents:
Class expr
val pcl_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.class_exprval pcl_constraint :
+ Astlib.Ast_500.Parsetree.class_expr ->
+ Astlib.Ast_500.Parsetree.class_type ->
+ Astlib.Ast_500.Parsetree.class_exprval pcl_let :
+ Astlib.Ast_500.Asttypes.rec_flag ->
+ Astlib.Ast_500.Parsetree.value_binding list ->
+ Astlib.Ast_500.Parsetree.class_expr ->
+ Astlib.Ast_500.Parsetree.class_exprpcl_let constructs an Ast.class_expr_desc.Pcl_let
Example OCaml
Pcl_let(rec, [(P1, E1); ... ; (Pn, En)], CE) represents:
let P1 = E1 and ... and Pn = EN in CE when rec is Nonrecursive,let rec P1 = E1 and ... and Pn = EN in CE when rec is Recursive.
val pcl_apply :
+ Astlib.Ast_500.Parsetree.class_expr ->
+ (Astlib.Ast_500.Asttypes.arg_label * Astlib.Ast_500.Parsetree.expression)
+ list ->
+ Astlib.Ast_500.Parsetree.class_exprpcl_apply constructs an Ast.class_expr_desc.Pcl_apply
Example OCaml
Pcl_apply(CE, [(l1,E1) ; ... ; (ln,En)]) represents CE ~l1:E1 ... ~ln:En. li can be empty (non labeled argument) or start with ? (optional argument).
Invariant: n > 0
val pcl_fun :
+ Astlib.Ast_500.Asttypes.arg_label ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.class_expr ->
+ Astlib.Ast_500.Parsetree.class_exprpcl_fun constructs an Ast.class_expr_desc.Pcl_fun
Example OCaml
Pcl_fun(lbl, exp0, P, CE) represents:
fun P -> CE when lbl is Nolabel and exp0 is None,fun ~l:P -> CE when lbl is Labelled l and exp0 is None,fun ?l:P -> CE when lbl is Optional l and exp0 is None,fun ?l:(P = E0) -> CE when lbl is Optional l and exp0 is Some E0.
val pcl_structure :
+ Astlib.Ast_500.Parsetree.class_structure ->
+ Astlib.Ast_500.Parsetree.class_exprval pcl_constr :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.class_exprCase
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.caseBinding op
val binding_op :
+ op:string Astlib.Location.loc ->
+ pat:Astlib.Ast_500.Parsetree.pattern ->
+ exp:Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.binding_opbinding_op constructs an Ast.binding_op
Attribute
val attribute :
+ name:string Astlib.Location.loc ->
+ payload:Astlib.Ast_500.Parsetree.payload ->
+ Astlib.Ast_500.Parsetree.attributeattribute constructs an Ast.attribute
Example OCaml
Attributes such as [@id ARG] and [@@id ARG].
Metadata containers passed around within the AST. The compiler ignores unknown attributes.
'a open infos
val open_infos :
+ expr:'a ->
+ override:Astlib.Ast_500.Asttypes.override_flag ->
+ 'a Astlib.Ast_500.Parsetree.open_infosopen_infos constructs an Ast.'aopen_infos
Example OCaml
Values of type 'a open_infos represents:
open! X when popen_override is Override (silences the "used identifier shadowing" warning)open X when popen_override is Fresh
'a include infos
val include_infos : 'a -> 'a Astlib.Ast_500.Parsetree.include_infosinclude_infos constructs an Ast.'ainclude_infos
'a class infos
val class_infos :
+ 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 ->
- constructors:Astlib.Ast_500.Parsetree.extension_constructor list ->
- private_:Astlib.Ast_500.Asttypes.private_flag ->
- Astlib.Ast_500.Parsetree.type_extensionval value_binding :
- pat:Astlib.Ast_500.Parsetree.pattern ->
- expr:Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.value_bindingval value_description :
name:string Astlib.Location.loc ->
- type_:Astlib.Ast_500.Parsetree.core_type ->
- prim:string list ->
- Astlib.Ast_500.Parsetree.value_descriptionval eint : int -> Astlib.Ast_500.Parsetree.expressionval echar : char -> Astlib.Ast_500.Parsetree.expressionval estring : string -> Astlib.Ast_500.Parsetree.expressionval efloat : string -> Astlib.Ast_500.Parsetree.expressionval eint32 : int32 -> Astlib.Ast_500.Parsetree.expressionval eint64 : int64 -> Astlib.Ast_500.Parsetree.expressionval enativeint : nativeint -> Astlib.Ast_500.Parsetree.expressionval ebool : bool -> Astlib.Ast_500.Parsetree.expressionval pint : int -> Astlib.Ast_500.Parsetree.patternval pchar : char -> Astlib.Ast_500.Parsetree.patternval pstring : string -> Astlib.Ast_500.Parsetree.patternval pfloat : string -> Astlib.Ast_500.Parsetree.patternval pint32 : int32 -> Astlib.Ast_500.Parsetree.patternval pint64 : int64 -> Astlib.Ast_500.Parsetree.patternval pnativeint : nativeint -> Astlib.Ast_500.Parsetree.patternval pbool : bool -> Astlib.Ast_500.Parsetree.patternval eunit : Astlib.Ast_500.Parsetree.expressionval punit : Astlib.Ast_500.Parsetree.patternval evar : string -> Astlib.Ast_500.Parsetree.expressionevar 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 : string -> Astlib.Ast_500.Parsetree.patternval eapply :
+ expr:'a ->
+ 'a Astlib.Ast_500.Parsetree.class_infosclass_infos constructs an Ast.'aclass_infos
Example OCaml
Values of type class_expr class_infos represents:
class c = ...class ['a1,...,'an] c = ...class virtual c = ...
They are also used for "class type" declaration.
val eint : int -> Astlib.Ast_500.Parsetree.expressionval echar : char -> Astlib.Ast_500.Parsetree.expressionval estring : string -> Astlib.Ast_500.Parsetree.expressionval efloat : string -> Astlib.Ast_500.Parsetree.expressionval eint32 : int32 -> Astlib.Ast_500.Parsetree.expressionval eint64 : int64 -> Astlib.Ast_500.Parsetree.expressionval enativeint : nativeint -> Astlib.Ast_500.Parsetree.expressionval ebool : bool -> Astlib.Ast_500.Parsetree.expressionval pint : int -> Astlib.Ast_500.Parsetree.patternval pchar : char -> Astlib.Ast_500.Parsetree.patternval pstring : string -> Astlib.Ast_500.Parsetree.patternval pfloat : string -> Astlib.Ast_500.Parsetree.patternval pint32 : int32 -> Astlib.Ast_500.Parsetree.patternval pint64 : int64 -> Astlib.Ast_500.Parsetree.patternval pnativeint : nativeint -> Astlib.Ast_500.Parsetree.patternval pbool : bool -> Astlib.Ast_500.Parsetree.patternval eunit : Astlib.Ast_500.Parsetree.expressionval punit : Astlib.Ast_500.Parsetree.patternval evar : string -> Astlib.Ast_500.Parsetree.expressionevar 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 : string -> Astlib.Ast_500.Parsetree.patternval eapply :
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression list ->
Astlib.Ast_500.Parsetree.expressionSame as pexp_apply but without labels
val eabstract :
diff --git a/ppxlib/Ppxlib/Ast_builder/module-type-S/index.html b/ppxlib/Ppxlib/Ast_builder/module-type-S/index.html
index aa643b6..8416f69 100644
--- a/ppxlib/Ppxlib/Ast_builder/module-type-S/index.html
+++ b/ppxlib/Ppxlib/Ast_builder/module-type-S/index.html
@@ -1,440 +1,22 @@
-S (ppxlib.Ppxlib.Ast_builder.S) Module type Ast_builder.S
module Located : sig ... endinclude sig ... end
val loc : Location.tval attribute :
+S (ppxlib.Ppxlib.Ast_builder.S) Module type Ast_builder.S
module Located : sig ... endval loc : Location.tValue description
val value_description :
name:string Astlib.Location.loc ->
- payload:Astlib.Ast_500.Parsetree.payload ->
- Astlib.Ast_500.Parsetree.attributeval binding_op :
- op:string Astlib.Location.loc ->
+ type_:Astlib.Ast_500.Parsetree.core_type ->
+ prim:string list ->
+ Astlib.Ast_500.Parsetree.value_descriptionvalue_description constructs an Ast.value_description
Example OCaml
Values of type value_description represents:
Value binding
val value_binding :
pat:Astlib.Ast_500.Parsetree.pattern ->
- exp:Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.binding_opval case :
- lhs:Astlib.Ast_500.Parsetree.pattern ->
- guard:Astlib.Ast_500.Parsetree.expression option ->
- rhs:Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.caseval pcl_constr :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.class_exprval pcl_structure :
- Astlib.Ast_500.Parsetree.class_structure ->
- Astlib.Ast_500.Parsetree.class_exprval pcl_fun :
- Astlib.Ast_500.Asttypes.arg_label ->
- Astlib.Ast_500.Parsetree.expression option ->
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.class_expr ->
- Astlib.Ast_500.Parsetree.class_exprval pcl_apply :
- Astlib.Ast_500.Parsetree.class_expr ->
- (Astlib.Ast_500.Asttypes.arg_label * Astlib.Ast_500.Parsetree.expression)
- list ->
- Astlib.Ast_500.Parsetree.class_exprval pcl_let :
- Astlib.Ast_500.Asttypes.rec_flag ->
- Astlib.Ast_500.Parsetree.value_binding list ->
- Astlib.Ast_500.Parsetree.class_expr ->
- Astlib.Ast_500.Parsetree.class_exprval pcl_constraint :
- Astlib.Ast_500.Parsetree.class_expr ->
- Astlib.Ast_500.Parsetree.class_type ->
- Astlib.Ast_500.Parsetree.class_exprval pcl_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.class_exprval pcf_inherit :
- Astlib.Ast_500.Asttypes.override_flag ->
- Astlib.Ast_500.Parsetree.class_expr ->
- string Astlib.Location.loc option ->
- Astlib.Ast_500.Parsetree.class_fieldval pcf_val :
- (string Astlib.Location.loc
- * Astlib.Ast_500.Asttypes.mutable_flag
- * Astlib.Ast_500.Parsetree.class_field_kind) ->
- Astlib.Ast_500.Parsetree.class_fieldval pcf_method :
- (string Astlib.Location.loc
- * Astlib.Ast_500.Asttypes.private_flag
- * Astlib.Ast_500.Parsetree.class_field_kind) ->
- Astlib.Ast_500.Parsetree.class_fieldval pcf_constraint :
- (Astlib.Ast_500.Parsetree.core_type * Astlib.Ast_500.Parsetree.core_type) ->
- Astlib.Ast_500.Parsetree.class_fieldval pcf_initializer :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.class_fieldval pcf_attribute :
- Astlib.Ast_500.Parsetree.attribute ->
- Astlib.Ast_500.Parsetree.class_fieldval pcf_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.class_fieldval class_infos :
- virt:Astlib.Ast_500.Asttypes.virtual_flag ->
+ expr:Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.value_bindingvalue_binding constructs an Ast.value_binding
Type extension
val type_extension :
+ 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 ->
- name:string Astlib.Location.loc ->
- expr:'a ->
- 'a Astlib.Ast_500.Parsetree.class_infosval class_signature :
- self:Astlib.Ast_500.Parsetree.core_type ->
- fields:Astlib.Ast_500.Parsetree.class_type_field list ->
- Astlib.Ast_500.Parsetree.class_signatureval class_structure :
- self:Astlib.Ast_500.Parsetree.pattern ->
- fields:Astlib.Ast_500.Parsetree.class_field list ->
- Astlib.Ast_500.Parsetree.class_structureval pcty_constr :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.class_typeval pcty_signature :
- Astlib.Ast_500.Parsetree.class_signature ->
- Astlib.Ast_500.Parsetree.class_typeval pcty_arrow :
- Astlib.Ast_500.Asttypes.arg_label ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.class_type ->
- Astlib.Ast_500.Parsetree.class_typeval pcty_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.class_typeval pctf_inherit :
- Astlib.Ast_500.Parsetree.class_type ->
- Astlib.Ast_500.Parsetree.class_type_fieldval pctf_val :
- (string Astlib.Location.loc
- * Astlib.Ast_500.Asttypes.mutable_flag
- * Astlib.Ast_500.Asttypes.virtual_flag
- * Astlib.Ast_500.Parsetree.core_type) ->
- Astlib.Ast_500.Parsetree.class_type_fieldval pctf_method :
- (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_fieldval pctf_constraint :
- (Astlib.Ast_500.Parsetree.core_type * Astlib.Ast_500.Parsetree.core_type) ->
- Astlib.Ast_500.Parsetree.class_type_fieldval pctf_attribute :
- Astlib.Ast_500.Parsetree.attribute ->
- Astlib.Ast_500.Parsetree.class_type_fieldval pctf_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.class_type_fieldval ptyp_any : Astlib.Ast_500.Parsetree.core_typeval ptyp_var : string -> Astlib.Ast_500.Parsetree.core_typeval ptyp_arrow :
- Astlib.Ast_500.Asttypes.arg_label ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_tuple :
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_constr :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_object :
- Astlib.Ast_500.Parsetree.object_field list ->
- Astlib.Ast_500.Asttypes.closed_flag ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_class :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_alias :
- Astlib.Ast_500.Parsetree.core_type ->
- string ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_variant :
- Astlib.Ast_500.Parsetree.row_field list ->
- Astlib.Ast_500.Asttypes.closed_flag ->
- string list option ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_poly :
- string Astlib.Location.loc list ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_package :
- (Astlib.Longident.t Astlib.Location.loc
- * (Astlib.Longident.t Astlib.Location.loc
- * Astlib.Ast_500.Parsetree.core_type)
- list) ->
- Astlib.Ast_500.Parsetree.core_typeval ptyp_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.core_typeval pdir_string : string -> Astlib.Ast_500.Parsetree.directive_argumentval pdir_int :
- string ->
- char option ->
- Astlib.Ast_500.Parsetree.directive_argumentval pdir_ident :
- Astlib.Longident.t ->
- Astlib.Ast_500.Parsetree.directive_argumentval pdir_bool : bool -> Astlib.Ast_500.Parsetree.directive_argumentval pexp_ident :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expressionval pexp_constant :
- Astlib.Ast_500.Parsetree.constant ->
- Astlib.Ast_500.Parsetree.expressionval pexp_let :
- Astlib.Ast_500.Asttypes.rec_flag ->
- Astlib.Ast_500.Parsetree.value_binding list ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_function :
- Astlib.Ast_500.Parsetree.case list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_fun :
- Astlib.Ast_500.Asttypes.arg_label ->
- Astlib.Ast_500.Parsetree.expression option ->
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_apply :
- Astlib.Ast_500.Parsetree.expression ->
- (Astlib.Ast_500.Asttypes.arg_label * Astlib.Ast_500.Parsetree.expression)
- list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_match :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.case list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_try :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.case list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_tuple :
- Astlib.Ast_500.Parsetree.expression list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_construct :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expression option ->
- Astlib.Ast_500.Parsetree.expressionval pexp_variant :
- string ->
- Astlib.Ast_500.Parsetree.expression option ->
- Astlib.Ast_500.Parsetree.expressionval pexp_record :
- (Astlib.Longident.t Astlib.Location.loc * Astlib.Ast_500.Parsetree.expression)
- list ->
- Astlib.Ast_500.Parsetree.expression option ->
- Astlib.Ast_500.Parsetree.expressionval pexp_field :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expressionval pexp_setfield :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_array :
- Astlib.Ast_500.Parsetree.expression list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_ifthenelse :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expression option ->
- Astlib.Ast_500.Parsetree.expressionval pexp_sequence :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_while :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_constraint :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.expressionval pexp_coerce :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.core_type option ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.expressionval pexp_send :
- Astlib.Ast_500.Parsetree.expression ->
- string Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expressionval pexp_new :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expressionval pexp_setinstvar :
- string Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_override :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.expression) list ->
- Astlib.Ast_500.Parsetree.expressionval pexp_letmodule :
- string option Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_letexception :
+ constructors:Astlib.Ast_500.Parsetree.extension_constructor list ->
+ private_:Astlib.Ast_500.Asttypes.private_flag ->
+ Astlib.Ast_500.Parsetree.type_extensiontype_extension constructs an Ast.type_extension
Example OCaml
Definition of new extensions constructors for the extensive sum type t (type t += ...).
Type exception
val type_exception :
Astlib.Ast_500.Parsetree.extension_constructor ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_assert :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_lazy :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_poly :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.core_type option ->
- Astlib.Ast_500.Parsetree.expressionval pexp_object :
- Astlib.Ast_500.Parsetree.class_structure ->
- Astlib.Ast_500.Parsetree.expressionval pexp_newtype :
- string Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.expressionval pexp_pack :
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.expressionval pexp_letop :
- Astlib.Ast_500.Parsetree.letop ->
- Astlib.Ast_500.Parsetree.expressionval pexp_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.expressionval pexp_unreachable : Astlib.Ast_500.Parsetree.expressionval extension_constructor :
- name:string Astlib.Location.loc ->
- kind:Astlib.Ast_500.Parsetree.extension_constructor_kind ->
- Astlib.Ast_500.Parsetree.extension_constructorval include_infos : 'a -> 'a Astlib.Ast_500.Parsetree.include_infosval label_declaration :
- name:string Astlib.Location.loc ->
- mutable_:Astlib.Ast_500.Asttypes.mutable_flag ->
- type_:Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.label_declarationval 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.letopval location :
- start:Stdlib.Lexing.position ->
- end_:Stdlib.Lexing.position ->
- ghost:bool ->
- Astlib.Location.tval module_binding :
- name:string option Astlib.Location.loc ->
- expr:Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_bindingval module_declaration :
- name:string option Astlib.Location.loc ->
- type_:Astlib.Ast_500.Parsetree.module_type ->
- Astlib.Ast_500.Parsetree.module_declarationval pmod_ident :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_structure :
- Astlib.Ast_500.Parsetree.structure_item list ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_functor :
- Astlib.Ast_500.Parsetree.functor_parameter ->
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_apply :
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_constraint :
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_type ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_unpack :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.module_exprval pmod_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.module_exprval module_substitution :
- name:string Astlib.Location.loc ->
- manifest:Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.module_substitutionval pmty_ident :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_signature :
- Astlib.Ast_500.Parsetree.signature_item list ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_functor :
- Astlib.Ast_500.Parsetree.functor_parameter ->
- Astlib.Ast_500.Parsetree.module_type ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_with :
- Astlib.Ast_500.Parsetree.module_type ->
- Astlib.Ast_500.Parsetree.with_constraint list ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_typeof :
- Astlib.Ast_500.Parsetree.module_expr ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.module_typeval pmty_alias :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.module_typeval module_type_declaration :
- name:string Astlib.Location.loc ->
- type_:Astlib.Ast_500.Parsetree.module_type option ->
- Astlib.Ast_500.Parsetree.module_type_declarationval otag :
- string Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.object_fieldval oinherit :
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.object_fieldval open_infos :
- expr:'a ->
- override:Astlib.Ast_500.Asttypes.override_flag ->
- 'a Astlib.Ast_500.Parsetree.open_infosval ppat_any : Astlib.Ast_500.Parsetree.patternval ppat_var : string Astlib.Location.loc -> Astlib.Ast_500.Parsetree.patternval ppat_alias :
- Astlib.Ast_500.Parsetree.pattern ->
- string Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.patternval ppat_constant :
- Astlib.Ast_500.Parsetree.constant ->
- Astlib.Ast_500.Parsetree.patternval ppat_interval :
- Astlib.Ast_500.Parsetree.constant ->
- Astlib.Ast_500.Parsetree.constant ->
- Astlib.Ast_500.Parsetree.patternval ppat_tuple :
- Astlib.Ast_500.Parsetree.pattern list ->
- Astlib.Ast_500.Parsetree.patternval ppat_variant :
- string ->
- Astlib.Ast_500.Parsetree.pattern option ->
- Astlib.Ast_500.Parsetree.patternval ppat_record :
- (Astlib.Longident.t Astlib.Location.loc * Astlib.Ast_500.Parsetree.pattern)
- list ->
- Astlib.Ast_500.Asttypes.closed_flag ->
- Astlib.Ast_500.Parsetree.patternval ppat_array :
- Astlib.Ast_500.Parsetree.pattern list ->
- Astlib.Ast_500.Parsetree.patternval ppat_or :
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.patternval ppat_constraint :
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.patternval ppat_type :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.patternval ppat_lazy :
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.patternval ppat_unpack :
- string option Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.patternval ppat_exception :
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.patternval ppat_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.patternval ppat_open :
- Astlib.Longident.t Astlib.Location.loc ->
- Astlib.Ast_500.Parsetree.pattern ->
- Astlib.Ast_500.Parsetree.patternval position :
- fname:string ->
- lnum:int ->
- bol:int ->
- cnum:int ->
- Stdlib.Lexing.positionval rtag :
- string Astlib.Location.loc ->
- bool ->
- Astlib.Ast_500.Parsetree.core_type list ->
- Astlib.Ast_500.Parsetree.row_fieldval rinherit :
- Astlib.Ast_500.Parsetree.core_type ->
- Astlib.Ast_500.Parsetree.row_fieldval psig_value :
- Astlib.Ast_500.Parsetree.value_description ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_type :
- Astlib.Ast_500.Asttypes.rec_flag ->
- Astlib.Ast_500.Parsetree.type_declaration list ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_typesubst :
- Astlib.Ast_500.Parsetree.type_declaration list ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_typext :
- Astlib.Ast_500.Parsetree.type_extension ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_exception :
- Astlib.Ast_500.Parsetree.type_exception ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_module :
- Astlib.Ast_500.Parsetree.module_declaration ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_modsubst :
- Astlib.Ast_500.Parsetree.module_substitution ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_recmodule :
- Astlib.Ast_500.Parsetree.module_declaration list ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_modtype :
- Astlib.Ast_500.Parsetree.module_type_declaration ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_modtypesubst :
- Astlib.Ast_500.Parsetree.module_type_declaration ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_class :
- Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_class_type :
- Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_attribute :
- Astlib.Ast_500.Parsetree.attribute ->
- Astlib.Ast_500.Parsetree.signature_itemval psig_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.attribute list ->
- Astlib.Ast_500.Parsetree.signature_itemval pstr_eval :
- Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.attribute list ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_value :
- Astlib.Ast_500.Asttypes.rec_flag ->
- Astlib.Ast_500.Parsetree.value_binding list ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_primitive :
- Astlib.Ast_500.Parsetree.value_description ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_type :
- Astlib.Ast_500.Asttypes.rec_flag ->
- Astlib.Ast_500.Parsetree.type_declaration list ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_typext :
- Astlib.Ast_500.Parsetree.type_extension ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_exception :
- Astlib.Ast_500.Parsetree.type_exception ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_module :
- Astlib.Ast_500.Parsetree.module_binding ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_recmodule :
- Astlib.Ast_500.Parsetree.module_binding list ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_modtype :
- Astlib.Ast_500.Parsetree.module_type_declaration ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_class :
- Astlib.Ast_500.Parsetree.class_expr Astlib.Ast_500.Parsetree.class_infos list ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_class_type :
- Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_attribute :
- Astlib.Ast_500.Parsetree.attribute ->
- Astlib.Ast_500.Parsetree.structure_itemval pstr_extension :
- (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
- Astlib.Ast_500.Parsetree.attribute list ->
- Astlib.Ast_500.Parsetree.structure_itemval toplevel_directive :
- name:string Astlib.Location.loc ->
- arg:Astlib.Ast_500.Parsetree.directive_argument option ->
- Astlib.Ast_500.Parsetree.toplevel_directiveval type_declaration :
+ Astlib.Ast_500.Parsetree.type_exceptiontype_exception constructs an Ast.type_exception
Example OCaml
Definition of a new exception (exception E).
Type declaration
val type_declaration :
name:string Astlib.Location.loc ->
params:
(Astlib.Ast_500.Parsetree.core_type
@@ -448,24 +30,442 @@
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_declarationval type_exception :
+ Astlib.Ast_500.Parsetree.type_declarationtype_declaration constructs an Ast.type_declaration
Example OCaml
Here are type declarations and their representation, for various ptype_kind and ptype_manifest values:
type t when type_kind is Ptype_abstract, and manifest is None,type t = T0 when type_kind is Ptype_abstract, and manifest is Some T0,type t = C of T | ... when type_kind is Ptype_variant, and manifest is None,type t = T0 = C of T | ... when type_kind is Ptype_variant, and manifest is Some T0,type t = {l: T; ...} when type_kind is Ptype_record, and manifest is None,type t = T0 = {l : T; ...} when type_kind is Ptype_record, and manifest is Some T0,type t = .. when type_kind is Ptype_open, and manifest is None.
Toplevel directive
val toplevel_directive :
+ name:string Astlib.Location.loc ->
+ arg:Astlib.Ast_500.Parsetree.directive_argument option ->
+ Astlib.Ast_500.Parsetree.toplevel_directivetoplevel_directive constructs an Ast.toplevel_directive
Structure item
val pstr_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.attribute list ->
+ Astlib.Ast_500.Parsetree.structure_itemval pstr_attribute :
+ Astlib.Ast_500.Parsetree.attribute ->
+ Astlib.Ast_500.Parsetree.structure_itemval pstr_class_type :
+ Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_class_type constructs an Ast.structure_item_desc.Pstr_class_type
Example OCaml
class type ct1 = ... and ... and ctn = ...
val pstr_class :
+ Astlib.Ast_500.Parsetree.class_expr Astlib.Ast_500.Parsetree.class_infos list ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_class constructs an Ast.structure_item_desc.Pstr_class
Example OCaml
class c1 = ... and ... and cn = ...
val pstr_modtype :
+ Astlib.Ast_500.Parsetree.module_type_declaration ->
+ Astlib.Ast_500.Parsetree.structure_itemval pstr_recmodule :
+ Astlib.Ast_500.Parsetree.module_binding list ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_recmodule constructs an Ast.structure_item_desc.Pstr_recmodule
Example OCaml
module rec X1 = ME1 and ... and Xn = MEn
val pstr_module :
+ Astlib.Ast_500.Parsetree.module_binding ->
+ Astlib.Ast_500.Parsetree.structure_itemval pstr_exception :
+ Astlib.Ast_500.Parsetree.type_exception ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_exception constructs an Ast.structure_item_desc.Pstr_exception
Example OCaml
exception C of Texception C = M.X
val pstr_typext :
+ Astlib.Ast_500.Parsetree.type_extension ->
+ Astlib.Ast_500.Parsetree.structure_itemval pstr_type :
+ Astlib.Ast_500.Asttypes.rec_flag ->
+ Astlib.Ast_500.Parsetree.type_declaration list ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_type constructs an Ast.structure_item_desc.Pstr_type
Example OCaml
type t1 = ... and ... and tn = ...
val pstr_primitive :
+ Astlib.Ast_500.Parsetree.value_description ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_primitive constructs an Ast.structure_item_desc.Pstr_primitive
Example OCaml
val x: Texternal x: T = "s1" ... "sn"
val pstr_value :
+ Astlib.Ast_500.Asttypes.rec_flag ->
+ Astlib.Ast_500.Parsetree.value_binding list ->
+ Astlib.Ast_500.Parsetree.structure_itempstr_value constructs an Ast.structure_item_desc.Pstr_value
Example OCaml
Pstr_value(rec, [(P1, E1 ; ... ; (Pn, En))]) represents:
let P1 = E1 and ... and Pn = EN when rec is Nonrecursive,let rec P1 = E1 and ... and Pn = EN when rec is Recursive.
val pstr_eval :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.attribute list ->
+ Astlib.Ast_500.Parsetree.structure_itemSignature item
val psig_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.attribute list ->
+ Astlib.Ast_500.Parsetree.signature_itemval psig_attribute :
+ Astlib.Ast_500.Parsetree.attribute ->
+ Astlib.Ast_500.Parsetree.signature_itemval psig_class_type :
+ Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_class_type constructs an Ast.signature_item_desc.Psig_class_type
Example OCaml
class type ct1 = ... and ... and ctn = ...
val psig_class :
+ Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos list ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_class constructs an Ast.signature_item_desc.Psig_class
Example OCaml
class c1 : ... and ... and cn : ...
val psig_modtypesubst :
+ Astlib.Ast_500.Parsetree.module_type_declaration ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_modtypesubst constructs an Ast.signature_item_desc.Psig_modtypesubst
Example OCaml
module type S := ...
val psig_modtype :
+ Astlib.Ast_500.Parsetree.module_type_declaration ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_modtype constructs an Ast.signature_item_desc.Psig_modtype
Example OCaml
module type S = MT and module type S
val psig_recmodule :
+ Astlib.Ast_500.Parsetree.module_declaration list ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_recmodule constructs an Ast.signature_item_desc.Psig_recmodule
Example OCaml
module rec X1 : MT1 and ... and Xn : MTn
val psig_modsubst :
+ Astlib.Ast_500.Parsetree.module_substitution ->
+ Astlib.Ast_500.Parsetree.signature_itemval psig_module :
+ Astlib.Ast_500.Parsetree.module_declaration ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_module constructs an Ast.signature_item_desc.Psig_module
Example OCaml
module X = M and module X : MT
val psig_exception :
+ Astlib.Ast_500.Parsetree.type_exception ->
+ Astlib.Ast_500.Parsetree.signature_itemval psig_typext :
+ Astlib.Ast_500.Parsetree.type_extension ->
+ Astlib.Ast_500.Parsetree.signature_itemval psig_typesubst :
+ Astlib.Ast_500.Parsetree.type_declaration list ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_typesubst constructs an Ast.signature_item_desc.Psig_typesubst
Example OCaml
type t1 := ... and ... and tn := ...
val psig_type :
+ Astlib.Ast_500.Asttypes.rec_flag ->
+ Astlib.Ast_500.Parsetree.type_declaration list ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_type constructs an Ast.signature_item_desc.Psig_type
Example OCaml
type t1 = ... and ... and tn = ...
val psig_value :
+ Astlib.Ast_500.Parsetree.value_description ->
+ Astlib.Ast_500.Parsetree.signature_itempsig_value constructs an Ast.signature_item_desc.Psig_value
Example OCaml
val x: Texternal x: T = "s1" ... "sn"
Row field
val rinherit :
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.row_fieldval rtag :
+ string Astlib.Location.loc ->
+ bool ->
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.row_fieldrtag constructs an Ast.row_field_desc.Rtag
Example OCaml
Rtag(`A, b, l) represents:
`A when b is true and l is [],`A of T when b is false and l is [T],`A of T1 & .. & Tn when b is false and l is [T1;...Tn],`A of & T1 & .. & Tn when b is true and l is [T1;...Tn].
- The
bool field is true if the tag contains a constant (empty) constructor. & occurs when several types are used for the same constructor (see 4.2 in the manual)
Position
val position :
+ fname:string ->
+ lnum:int ->
+ bol:int ->
+ cnum:int ->
+ Stdlib.Lexing.positionposition constructs an Ast.position
Pattern
val ppat_open :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.patternval ppat_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.patternval ppat_exception :
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.patternval ppat_unpack :
+ string option Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.patternppat_unpack constructs an Ast.pattern_desc.Ppat_unpack
Example OCaml
Ppat_unpack(s) represents:
(module P) when s is Some "P"(module _) when s is None
Note: (module P : S) is represented as Ppat_constraint(Ppat_unpack(Some "P"), Ptyp_package S)
val ppat_lazy :
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.patternval ppat_type :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.patternval ppat_constraint :
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.patternval ppat_or :
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.patternval ppat_array :
+ Astlib.Ast_500.Parsetree.pattern list ->
+ Astlib.Ast_500.Parsetree.patternval ppat_record :
+ (Astlib.Longident.t Astlib.Location.loc * Astlib.Ast_500.Parsetree.pattern)
+ list ->
+ Astlib.Ast_500.Asttypes.closed_flag ->
+ Astlib.Ast_500.Parsetree.patternppat_record constructs an Ast.pattern_desc.Ppat_record
Example OCaml
Ppat_record([(l1, P1) ; ... ; (ln, Pn)], flag) represents:
Invariant: n > 0
val ppat_variant :
+ string ->
+ Astlib.Ast_500.Parsetree.pattern option ->
+ Astlib.Ast_500.Parsetree.patternppat_variant constructs an Ast.pattern_desc.Ppat_variant
Example OCaml
Ppat_variant(`A, pat) represents:
`A when pat is None,`A P when pat is Some P
val ppat_tuple :
+ Astlib.Ast_500.Parsetree.pattern list ->
+ Astlib.Ast_500.Parsetree.patternppat_tuple constructs an Ast.pattern_desc.Ppat_tuple
Example OCaml
Patterns (P1, ..., Pn).
Invariant: n >= 2
val ppat_interval :
+ Astlib.Ast_500.Parsetree.constant ->
+ Astlib.Ast_500.Parsetree.constant ->
+ Astlib.Ast_500.Parsetree.patternppat_interval constructs an Ast.pattern_desc.Ppat_interval
Example OCaml
Patterns such as 'a'..'z'.
Other forms of interval are recognized by the parser but rejected by the type-checker.
val ppat_constant :
+ Astlib.Ast_500.Parsetree.constant ->
+ Astlib.Ast_500.Parsetree.patternppat_constant constructs an Ast.pattern_desc.Ppat_constant
Example OCaml
Patterns such as 1, 'a', "true", 1.0, 1l, 1L, 1n
val ppat_alias :
+ Astlib.Ast_500.Parsetree.pattern ->
+ string Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.patternval ppat_var : string Astlib.Location.loc -> Astlib.Ast_500.Parsetree.patternval ppat_any : Astlib.Ast_500.Parsetree.patternObject field
val oinherit :
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.object_fieldoinherit constructs an Ast.object_field_desc.Oinherit
val otag :
+ string Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.object_fieldotag constructs an Ast.object_field_desc.Otag
Module type declaration
val module_type_declaration :
+ name:string Astlib.Location.loc ->
+ type_:Astlib.Ast_500.Parsetree.module_type option ->
+ Astlib.Ast_500.Parsetree.module_type_declarationmodule_type_declaration constructs an Ast.module_type_declaration
Example OCaml
Values of type module_type_declaration represents:
S = MT,S for abstract module type declaration, when pmtd_type is None.
Module type
val pmty_alias :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_typeof :
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_with :
+ Astlib.Ast_500.Parsetree.module_type ->
+ Astlib.Ast_500.Parsetree.with_constraint list ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_functor :
+ Astlib.Ast_500.Parsetree.functor_parameter ->
+ Astlib.Ast_500.Parsetree.module_type ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_signature :
+ Astlib.Ast_500.Parsetree.signature_item list ->
+ Astlib.Ast_500.Parsetree.module_typeval pmty_ident :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.module_typeModule substitution
val module_substitution :
+ name:string Astlib.Location.loc ->
+ manifest:Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.module_substitutionmodule_substitution constructs an Ast.module_substitution
Example OCaml
Values of type module_substitution represents S := M
Module expr
val pmod_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_unpack :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_constraint :
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_type ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_apply :
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_functor :
+ Astlib.Ast_500.Parsetree.functor_parameter ->
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_structure :
+ Astlib.Ast_500.Parsetree.structure_item list ->
+ Astlib.Ast_500.Parsetree.module_exprval pmod_ident :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.module_exprModule declaration
val module_declaration :
+ name:string option Astlib.Location.loc ->
+ type_:Astlib.Ast_500.Parsetree.module_type ->
+ Astlib.Ast_500.Parsetree.module_declarationmodule_declaration constructs an Ast.module_declaration
Example OCaml
Values of type module_declaration represents S : MT
Module binding
val module_binding :
+ name:string option Astlib.Location.loc ->
+ expr:Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.module_bindingmodule_binding constructs an Ast.module_binding
Example OCaml
Values of type module_binding represents module X = ME
Location
val location :
+ start:Stdlib.Lexing.position ->
+ end_:Stdlib.Lexing.position ->
+ ghost:bool ->
+ Astlib.Location.tlocation constructs an Ast.location
Letop
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.letopletop constructs an Ast.letop
Label declaration
val label_declaration :
+ name:string Astlib.Location.loc ->
+ mutable_:Astlib.Ast_500.Asttypes.mutable_flag ->
+ type_:Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.label_declarationlabel_declaration constructs an Ast.label_declaration
Example OCaml
{ ...; l: T; ... } when pld_mutable is Immutable,{ ...; mutable l: T; ... } when pld_mutable is Mutable.
Note: T can be a Ptyp_poly.
Extension constructor
val extension_constructor :
+ name:string Astlib.Location.loc ->
+ kind:Astlib.Ast_500.Parsetree.extension_constructor_kind ->
+ Astlib.Ast_500.Parsetree.extension_constructorextension_constructor constructs an Ast.extension_constructor
Expression
val pexp_unreachable : Astlib.Ast_500.Parsetree.expressionval pexp_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_letop :
+ Astlib.Ast_500.Parsetree.letop ->
+ Astlib.Ast_500.Parsetree.expressionpexp_letop constructs an Ast.expression_desc.Pexp_letop
Example OCaml
let* P = E0 in E1let* P0 = E00 and* P1 = E01 in E1
val pexp_open :
+ Astlib.Ast_500.Parsetree.module_expr Astlib.Ast_500.Parsetree.open_infos ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_open constructs an Ast.expression_desc.Pexp_open
Example OCaml
M.(E)let open M in Elet open! M in E
val pexp_pack :
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.expressionpexp_pack constructs an Ast.expression_desc.Pexp_pack
Example OCaml
(module ME).
(module ME : S) is represented as Pexp_constraint(Pexp_pack ME, Ptyp_package S)
val pexp_newtype :
+ string Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_object :
+ Astlib.Ast_500.Parsetree.class_structure ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_poly :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.core_type option ->
+ Astlib.Ast_500.Parsetree.expressionpexp_poly constructs an Ast.expression_desc.Pexp_poly
Example OCaml
Used for method bodies.
Can only be used as the expression under Cfk_concrete for methods (not values).
val pexp_lazy :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_assert :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_assert constructs an Ast.expression_desc.Pexp_assert
Example OCaml
assert E.
Note: assert false is treated in a special way by the type-checker.
val pexp_letexception :
Astlib.Ast_500.Parsetree.extension_constructor ->
- Astlib.Ast_500.Parsetree.type_exceptionval type_extension :
- path:Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_letexception constructs an Ast.expression_desc.Pexp_letexception
Example OCaml
let exception C in E
val pexp_letmodule :
+ string option Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.module_expr ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_override :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.expression) list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_override constructs an Ast.expression_desc.Pexp_override
Example OCaml
{< x1 = E1; ...; xn = En >}
val pexp_setinstvar :
+ string Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_new :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_send :
+ Astlib.Ast_500.Parsetree.expression ->
+ string Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_coerce :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.core_type option ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.expressionpexp_coerce constructs an Ast.expression_desc.Pexp_coerce
Example OCaml
Pexp_coerce(E, from, T) represents
(E :> T) when from is None,(E : T0 :> T) when from is Some T0.
val pexp_constraint :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_for :
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Asttypes.direction_flag ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_for constructs an Ast.expression_desc.Pexp_for
Example OCaml
Pexp_for(i, E1, E2, direction, E3) represents:
val pexp_while :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_sequence :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_ifthenelse :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_array :
+ Astlib.Ast_500.Parsetree.expression list ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_setfield :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_field :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expressionval pexp_record :
+ (Astlib.Longident.t Astlib.Location.loc * Astlib.Ast_500.Parsetree.expression)
+ list ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.expressionpexp_record constructs an Ast.expression_desc.Pexp_record
Example OCaml
Pexp_record([(l1,P1) ; ... ; (ln,Pn)], exp0) represents
{ l1=P1; ...; ln=Pn } when exp0 is None{ E0 with l1=P1; ...; ln=Pn } when exp0 is Some E0
Invariant: n > 0
val pexp_variant :
+ string ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.expressionpexp_variant constructs an Ast.expression_desc.Pexp_variant
Example OCaml
Pexp_variant(`A, exp) represents
`A when exp is None`A E when exp is Some E
val pexp_construct :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.expressionpexp_construct constructs an Ast.expression_desc.Pexp_construct
Example OCaml
Pexp_construct(C, exp) represents:
C when exp is None,C E when exp is Some E,C (E1, ..., En) when exp is Some (Pexp_tuple[E1;...;En])
val pexp_tuple :
+ Astlib.Ast_500.Parsetree.expression list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_tuple constructs an Ast.expression_desc.Pexp_tuple
Example OCaml
Expressions (E1, ..., En)
Invariant: n >= 2
val pexp_try :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.case list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_try constructs an Ast.expression_desc.Pexp_try
Example OCaml
try E0 with P1 -> E1 | ... | Pn -> En
val pexp_match :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.case list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_match constructs an Ast.expression_desc.Pexp_match
Example OCaml
match E0 with P1 -> E1 | ... | Pn -> En
val pexp_apply :
+ Astlib.Ast_500.Parsetree.expression ->
+ (Astlib.Ast_500.Asttypes.arg_label * Astlib.Ast_500.Parsetree.expression)
+ list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_apply constructs an Ast.expression_desc.Pexp_apply
Example OCaml
Pexp_apply(E0, [(l1, E1) ; ... ; (ln, En)]) represents E0 ~l1:E1 ... ~ln:En
li can be Nolabel (non labeled argument), Labelled (labelled arguments) or Optional (optional argument).
Invariant: n > 0
val pexp_fun :
+ Astlib.Ast_500.Asttypes.arg_label ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_fun constructs an Ast.expression_desc.Pexp_fun
Example OCaml
Pexp_fun(lbl, exp0, P, E1) represents:
fun P -> E1 when lbl is Nolabel and exp0 is Nonefun ~l:P -> E1 when lbl is Labelled l and exp0 is Nonefun ?l:P -> E1 when lbl is Optional l and exp0 is Nonefun ?l:(P = E0) -> E1 when lbl is Optional l and exp0 is Some E0
Notes:
val pexp_function :
+ Astlib.Ast_500.Parsetree.case list ->
+ Astlib.Ast_500.Parsetree.expressionpexp_function constructs an Ast.expression_desc.Pexp_function
Example OCaml
function P1 -> E1 | ... | Pn -> En
val pexp_let :
+ Astlib.Ast_500.Asttypes.rec_flag ->
+ Astlib.Ast_500.Parsetree.value_binding list ->
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.expressionpexp_let constructs an Ast.expression_desc.Pexp_let
Example OCaml
Pexp_let(flag, [(P1,E1) ; ... ; (Pn,En)], E) represents:
let P1 = E1 and ... and Pn = EN in E when flag is Nonrecursive,let rec P1 = E1 and ... and Pn = EN in E when flag is Recursive.
val pexp_constant :
+ Astlib.Ast_500.Parsetree.constant ->
+ Astlib.Ast_500.Parsetree.expressionpexp_constant constructs an Ast.expression_desc.Pexp_constant
Example OCaml
Expressions constant such as 1, 'a', "true", 1.0, 1l, 1L, 1n
val pexp_ident :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.expressionDirective argument
val pdir_bool : bool -> Astlib.Ast_500.Parsetree.directive_argumentpdir_bool constructs an Ast.directive_argument_desc.Pdir_bool
val pdir_ident :
+ Astlib.Longident.t ->
+ Astlib.Ast_500.Parsetree.directive_argumentpdir_ident constructs an Ast.directive_argument_desc.Pdir_ident
val pdir_int :
+ string ->
+ char option ->
+ Astlib.Ast_500.Parsetree.directive_argumentpdir_int constructs an Ast.directive_argument_desc.Pdir_int
val pdir_string : string -> Astlib.Ast_500.Parsetree.directive_argumentpdir_string constructs an Ast.directive_argument_desc.Pdir_string
Core type
val ptyp_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.core_typeval ptyp_package :
+ (Astlib.Longident.t Astlib.Location.loc
+ * (Astlib.Longident.t Astlib.Location.loc
+ * Astlib.Ast_500.Parsetree.core_type)
+ list) ->
+ Astlib.Ast_500.Parsetree.core_typeval ptyp_poly :
+ string Astlib.Location.loc list ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_poly constructs an Ast.core_type_desc.Ptyp_poly
Example OCaml
'a1 ... 'an. T
Can only appear in the following context:
- As the
core_type of a Ppat_constraint node corresponding to a constraint on a let-binding:
let x : 'a1 ... 'an. T = e ...
- Under
Cfk_virtual for methods (not values).
- As the
core_type of a Pctf_method node.
- As the
pld_type field of a label_declaration.
- As a
core_type of a Ptyp_object node.
- As the
pval_type field of a value_description.
val ptyp_variant :
+ Astlib.Ast_500.Parsetree.row_field list ->
+ Astlib.Ast_500.Asttypes.closed_flag ->
+ string list option ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_variant constructs an Ast.core_type_desc.Ptyp_variant
Example OCaml
Ptyp_variant([`A;`B], flag, labels) represents:
val ptyp_alias :
+ Astlib.Ast_500.Parsetree.core_type ->
+ string ->
+ Astlib.Ast_500.Parsetree.core_typeval ptyp_class :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_class constructs an Ast.core_type_desc.Ptyp_class
Example OCaml
Ptyp_class(tconstr, l) represents:
#tconstr when l=[],T #tconstr when l=[T],(T1, ..., Tn) #tconstr when l=[T1 ; ... ; Tn].
val ptyp_object :
+ Astlib.Ast_500.Parsetree.object_field list ->
+ Astlib.Ast_500.Asttypes.closed_flag ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_object constructs an Ast.core_type_desc.Ptyp_object
Example OCaml
Ptyp_object([ l1:T1; ...; ln:Tn ], flag) represents:
val ptyp_constr :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_constr constructs an Ast.core_type_desc.Ptyp_constr
Example OCaml
Ptyp_constr(lident, l) represents:
tconstr when l=[],T tconstr when l=[T],(T1, ..., Tn) tconstr when l=[T1 ; ... ; Tn].
val ptyp_tuple :
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_tuple constructs an Ast.core_type_desc.Ptyp_tuple
Example OCaml
Ptyp_tuple([T1 ; ... ; Tn]) represents a product type T1 * ... * Tn.
Invariant: n >= 2.
val ptyp_arrow :
+ Astlib.Ast_500.Asttypes.arg_label ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.core_typeptyp_arrow constructs an Ast.core_type_desc.Ptyp_arrow
Example OCaml
Ptyp_arrow(lbl, T1, T2) represents:
val ptyp_var : string -> Astlib.Ast_500.Parsetree.core_typeval ptyp_any : Astlib.Ast_500.Parsetree.core_typeConstructor declaration
Class type field
val pctf_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.class_type_fieldval pctf_attribute :
+ Astlib.Ast_500.Parsetree.attribute ->
+ Astlib.Ast_500.Parsetree.class_type_fieldval pctf_constraint :
+ (Astlib.Ast_500.Parsetree.core_type * Astlib.Ast_500.Parsetree.core_type) ->
+ Astlib.Ast_500.Parsetree.class_type_fieldpctf_constraint constructs an Ast.class_type_field_desc.Pctf_constraint
Example OCaml
constraint T1 = T2
val pctf_method :
+ (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_fieldpctf_method constructs an Ast.class_type_field_desc.Pctf_method
Example OCaml
method x: T
Note: T can be a Ptyp_poly.
val pctf_val :
+ (string Astlib.Location.loc
+ * Astlib.Ast_500.Asttypes.mutable_flag
+ * Astlib.Ast_500.Asttypes.virtual_flag
+ * Astlib.Ast_500.Parsetree.core_type) ->
+ Astlib.Ast_500.Parsetree.class_type_fieldval pctf_inherit :
+ Astlib.Ast_500.Parsetree.class_type ->
+ Astlib.Ast_500.Parsetree.class_type_fieldClass type
val pcty_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.class_typeval pcty_arrow :
+ Astlib.Ast_500.Asttypes.arg_label ->
+ Astlib.Ast_500.Parsetree.core_type ->
+ Astlib.Ast_500.Parsetree.class_type ->
+ Astlib.Ast_500.Parsetree.class_typepcty_arrow constructs an Ast.class_type_desc.Pcty_arrow
Example OCaml
Pcty_arrow(lbl, T, CT) represents:
T -> CT when lbl is Nolabel,~l:T -> CT when lbl is Labelled l,?l:T -> CT when lbl is Optional l.
val pcty_signature :
+ Astlib.Ast_500.Parsetree.class_signature ->
+ Astlib.Ast_500.Parsetree.class_typeval pcty_constr :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.class_typeClass structure
val class_structure :
+ self:Astlib.Ast_500.Parsetree.pattern ->
+ fields:Astlib.Ast_500.Parsetree.class_field list ->
+ Astlib.Ast_500.Parsetree.class_structureclass_structure constructs an Ast.class_structure
Example OCaml
Values of type class_structure represents:
object(selfpat) ... endobject ... end when pcstr_self is Ppat_any
Class signature
val class_signature :
+ self:Astlib.Ast_500.Parsetree.core_type ->
+ fields:Astlib.Ast_500.Parsetree.class_type_field list ->
+ Astlib.Ast_500.Parsetree.class_signatureclass_signature constructs an Ast.class_signature
Example OCaml
Values of type class_signature represents:
object('selfpat) ... endobject ... end when pcsig_self is Ptyp_any
Class field
val pcf_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.class_fieldval pcf_attribute :
+ Astlib.Ast_500.Parsetree.attribute ->
+ Astlib.Ast_500.Parsetree.class_fieldval pcf_initializer :
+ Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.class_fieldval pcf_constraint :
+ (Astlib.Ast_500.Parsetree.core_type * Astlib.Ast_500.Parsetree.core_type) ->
+ Astlib.Ast_500.Parsetree.class_fieldval pcf_method :
+ (string Astlib.Location.loc
+ * Astlib.Ast_500.Asttypes.private_flag
+ * Astlib.Ast_500.Parsetree.class_field_kind) ->
+ Astlib.Ast_500.Parsetree.class_fieldpcf_method constructs an Ast.class_field_desc.Pcf_method
Example OCaml
val pcf_val :
+ (string Astlib.Location.loc
+ * Astlib.Ast_500.Asttypes.mutable_flag
+ * Astlib.Ast_500.Parsetree.class_field_kind) ->
+ Astlib.Ast_500.Parsetree.class_fieldpcf_val constructs an Ast.class_field_desc.Pcf_val
Example OCaml
Pcf_val(x,flag, kind) represents:
val x = E when flag is Immutable and kind is Cfk_concrete(Fresh, E)val virtual x: T when flag is Immutable and kind is Cfk_virtual(T)val mutable x = E when flag is Mutable and kind is Cfk_concrete(Fresh, E)val mutable virtual x: T when flag is Mutable and kind is Cfk_virtual(T)
val pcf_inherit :
+ Astlib.Ast_500.Asttypes.override_flag ->
+ Astlib.Ast_500.Parsetree.class_expr ->
+ string Astlib.Location.loc option ->
+ Astlib.Ast_500.Parsetree.class_fieldpcf_inherit constructs an Ast.class_field_desc.Pcf_inherit
Example OCaml
Pcf_inherit(flag, CE, s) represents:
Class expr
val pcl_extension :
+ (string Astlib.Location.loc * Astlib.Ast_500.Parsetree.payload) ->
+ Astlib.Ast_500.Parsetree.class_exprval pcl_constraint :
+ Astlib.Ast_500.Parsetree.class_expr ->
+ Astlib.Ast_500.Parsetree.class_type ->
+ Astlib.Ast_500.Parsetree.class_exprval pcl_let :
+ Astlib.Ast_500.Asttypes.rec_flag ->
+ Astlib.Ast_500.Parsetree.value_binding list ->
+ Astlib.Ast_500.Parsetree.class_expr ->
+ Astlib.Ast_500.Parsetree.class_exprpcl_let constructs an Ast.class_expr_desc.Pcl_let
Example OCaml
Pcl_let(rec, [(P1, E1); ... ; (Pn, En)], CE) represents:
let P1 = E1 and ... and Pn = EN in CE when rec is Nonrecursive,let rec P1 = E1 and ... and Pn = EN in CE when rec is Recursive.
val pcl_apply :
+ Astlib.Ast_500.Parsetree.class_expr ->
+ (Astlib.Ast_500.Asttypes.arg_label * Astlib.Ast_500.Parsetree.expression)
+ list ->
+ Astlib.Ast_500.Parsetree.class_exprpcl_apply constructs an Ast.class_expr_desc.Pcl_apply
Example OCaml
Pcl_apply(CE, [(l1,E1) ; ... ; (ln,En)]) represents CE ~l1:E1 ... ~ln:En. li can be empty (non labeled argument) or start with ? (optional argument).
Invariant: n > 0
val pcl_fun :
+ Astlib.Ast_500.Asttypes.arg_label ->
+ Astlib.Ast_500.Parsetree.expression option ->
+ Astlib.Ast_500.Parsetree.pattern ->
+ Astlib.Ast_500.Parsetree.class_expr ->
+ Astlib.Ast_500.Parsetree.class_exprpcl_fun constructs an Ast.class_expr_desc.Pcl_fun
Example OCaml
Pcl_fun(lbl, exp0, P, CE) represents:
fun P -> CE when lbl is Nolabel and exp0 is None,fun ~l:P -> CE when lbl is Labelled l and exp0 is None,fun ?l:P -> CE when lbl is Optional l and exp0 is None,fun ?l:(P = E0) -> CE when lbl is Optional l and exp0 is Some E0.
val pcl_structure :
+ Astlib.Ast_500.Parsetree.class_structure ->
+ Astlib.Ast_500.Parsetree.class_exprval pcl_constr :
+ Astlib.Longident.t Astlib.Location.loc ->
+ Astlib.Ast_500.Parsetree.core_type list ->
+ Astlib.Ast_500.Parsetree.class_exprCase
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.caseBinding op
val binding_op :
+ op:string Astlib.Location.loc ->
+ pat:Astlib.Ast_500.Parsetree.pattern ->
+ exp:Astlib.Ast_500.Parsetree.expression ->
+ Astlib.Ast_500.Parsetree.binding_opbinding_op constructs an Ast.binding_op
Attribute
val attribute :
+ name:string Astlib.Location.loc ->
+ payload:Astlib.Ast_500.Parsetree.payload ->
+ Astlib.Ast_500.Parsetree.attributeattribute constructs an Ast.attribute
Example OCaml
Attributes such as [@id ARG] and [@@id ARG].
Metadata containers passed around within the AST. The compiler ignores unknown attributes.
'a open infos
val open_infos :
+ expr:'a ->
+ override:Astlib.Ast_500.Asttypes.override_flag ->
+ 'a Astlib.Ast_500.Parsetree.open_infosopen_infos constructs an Ast.'aopen_infos
Example OCaml
Values of type 'a open_infos represents:
open! X when popen_override is Override (silences the "used identifier shadowing" warning)open X when popen_override is Fresh
'a include infos
val include_infos : 'a -> 'a Astlib.Ast_500.Parsetree.include_infosinclude_infos constructs an Ast.'ainclude_infos
'a class infos
val class_infos :
+ 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 ->
- constructors:Astlib.Ast_500.Parsetree.extension_constructor list ->
- private_:Astlib.Ast_500.Asttypes.private_flag ->
- Astlib.Ast_500.Parsetree.type_extensionval value_binding :
- pat:Astlib.Ast_500.Parsetree.pattern ->
- expr:Astlib.Ast_500.Parsetree.expression ->
- Astlib.Ast_500.Parsetree.value_bindingval value_description :
name:string Astlib.Location.loc ->
- type_:Astlib.Ast_500.Parsetree.core_type ->
- prim:string list ->
- Astlib.Ast_500.Parsetree.value_descriptionval eint : int -> Astlib.Ast_500.Parsetree.expressionval echar : char -> Astlib.Ast_500.Parsetree.expressionval estring : string -> Astlib.Ast_500.Parsetree.expressionval efloat : string -> Astlib.Ast_500.Parsetree.expressionval eint32 : int32 -> Astlib.Ast_500.Parsetree.expressionval eint64 : int64 -> Astlib.Ast_500.Parsetree.expressionval enativeint : nativeint -> Astlib.Ast_500.Parsetree.expressionval ebool : bool -> Astlib.Ast_500.Parsetree.expressionval pint : int -> Astlib.Ast_500.Parsetree.patternval pchar : char -> Astlib.Ast_500.Parsetree.patternval pstring : string -> Astlib.Ast_500.Parsetree.patternval pfloat : string -> Astlib.Ast_500.Parsetree.patternval pint32 : int32 -> Astlib.Ast_500.Parsetree.patternval pint64 : int64 -> Astlib.Ast_500.Parsetree.patternval pnativeint : nativeint -> Astlib.Ast_500.Parsetree.patternval pbool : bool -> Astlib.Ast_500.Parsetree.patternval eunit : Astlib.Ast_500.Parsetree.expressionval punit : Astlib.Ast_500.Parsetree.patternval evar : string -> Astlib.Ast_500.Parsetree.expressionevar 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 : string -> Astlib.Ast_500.Parsetree.patternval eapply :
+ expr:'a ->
+ 'a Astlib.Ast_500.Parsetree.class_infosclass_infos constructs an Ast.'aclass_infos
Example OCaml
Values of type class_expr class_infos represents:
class c = ...class ['a1,...,'an] c = ...class virtual c = ...
They are also used for "class type" declaration.
val eint : int -> Astlib.Ast_500.Parsetree.expressionval echar : char -> Astlib.Ast_500.Parsetree.expressionval estring : string -> Astlib.Ast_500.Parsetree.expressionval efloat : string -> Astlib.Ast_500.Parsetree.expressionval eint32 : int32 -> Astlib.Ast_500.Parsetree.expressionval eint64 : int64 -> Astlib.Ast_500.Parsetree.expressionval enativeint : nativeint -> Astlib.Ast_500.Parsetree.expressionval ebool : bool -> Astlib.Ast_500.Parsetree.expressionval pint : int -> Astlib.Ast_500.Parsetree.patternval pchar : char -> Astlib.Ast_500.Parsetree.patternval pstring : string -> Astlib.Ast_500.Parsetree.patternval pfloat : string -> Astlib.Ast_500.Parsetree.patternval pint32 : int32 -> Astlib.Ast_500.Parsetree.patternval pint64 : int64 -> Astlib.Ast_500.Parsetree.patternval pnativeint : nativeint -> Astlib.Ast_500.Parsetree.patternval pbool : bool -> Astlib.Ast_500.Parsetree.patternval eunit : Astlib.Ast_500.Parsetree.expressionval punit : Astlib.Ast_500.Parsetree.patternval evar : string -> Astlib.Ast_500.Parsetree.expressionevar 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 : string -> Astlib.Ast_500.Parsetree.patternval eapply :
Astlib.Ast_500.Parsetree.expression ->
Astlib.Ast_500.Parsetree.expression list ->
Astlib.Ast_500.Parsetree.expressionSame as pexp_apply but without labels
val eabstract :
diff --git a/ppxlib/Ppxlib/Attribute/Context/index.html b/ppxlib/Ppxlib/Attribute/Context/index.html
index e2eb633..63798e9 100644
--- a/ppxlib/Ppxlib/Attribute/Context/index.html
+++ b/ppxlib/Ppxlib/Attribute/Context/index.html
@@ -1,9 +1,12 @@
-Context (ppxlib.Ppxlib.Attribute.Context) Module Attribute.Context
type 'a t = | Label_declaration : Astlib.Ast_500.Parsetree.label_declaration t| Constructor_declaration : Astlib.Ast_500.Parsetree.constructor_declaration t| Type_declaration : Astlib.Ast_500.Parsetree.type_declaration t| Type_exception : Astlib.Ast_500.Parsetree.type_exception t| Type_extension : Astlib.Ast_500.Parsetree.type_extension t| Extension_constructor : Astlib.Ast_500.Parsetree.extension_constructor t| Pattern : Astlib.Ast_500.Parsetree.pattern t| Core_type : Astlib.Ast_500.Parsetree.core_type t| Expression : Astlib.Ast_500.Parsetree.expression t| Value_description : Astlib.Ast_500.Parsetree.value_description t| Class_type : Astlib.Ast_500.Parsetree.class_type t| Class_type_field : Astlib.Ast_500.Parsetree.class_type_field t| Class_infos : _ Astlib.Ast_500.Parsetree.class_infos t| Class_expr : Astlib.Ast_500.Parsetree.class_expr t| Class_field : Astlib.Ast_500.Parsetree.class_field t| Module_type : Astlib.Ast_500.Parsetree.module_type t| Module_declaration : Astlib.Ast_500.Parsetree.module_declaration t| Module_type_declaration : Astlib.Ast_500.Parsetree.module_type_declaration t| Module_substitution : Astlib.Ast_500.Parsetree.module_substitution t| Open_description : Astlib.Longident.t Astlib.Location.loc
+Context (ppxlib.Ppxlib.Attribute.Context) Module Attribute.Context
type 'a t = | Label_declaration : Astlib.Ast_500.Parsetree.label_declaration t| Constructor_declaration : Astlib.Ast_500.Parsetree.constructor_declaration t| Type_declaration : Astlib.Ast_500.Parsetree.type_declaration t| Type_exception : Astlib.Ast_500.Parsetree.type_exception t| Type_extension : Astlib.Ast_500.Parsetree.type_extension t| Extension_constructor : Astlib.Ast_500.Parsetree.extension_constructor t| Pattern : Astlib.Ast_500.Parsetree.pattern t| Core_type : Astlib.Ast_500.Parsetree.core_type t| Expression : Astlib.Ast_500.Parsetree.expression t| Value_description : Astlib.Ast_500.Parsetree.value_description t| Class_type : Astlib.Ast_500.Parsetree.class_type t| Class_type_field : Astlib.Ast_500.Parsetree.class_type_field t| Class_infos : _ Astlib.Ast_500.Parsetree.class_infos t| Class_expr : Astlib.Ast_500.Parsetree.class_expr t| Class_field : Astlib.Ast_500.Parsetree.class_field t| Class_type_decl : Astlib.Ast_500.Parsetree.class_type
+ Astlib.Ast_500.Parsetree.class_infos
+ t| Module_type : Astlib.Ast_500.Parsetree.module_type t| Module_declaration : Astlib.Ast_500.Parsetree.module_declaration t| Module_type_declaration : Astlib.Ast_500.Parsetree.module_type_declaration t| Module_substitution : Astlib.Ast_500.Parsetree.module_substitution t| Open_description : Astlib.Longident.t Astlib.Location.loc
Astlib.Ast_500.Parsetree.open_infos
t| Open_declaration : Astlib.Ast_500.Parsetree.module_expr
Astlib.Ast_500.Parsetree.open_infos
t| Include_infos : _ Astlib.Ast_500.Parsetree.include_infos t| Module_expr : Astlib.Ast_500.Parsetree.module_expr t| Value_binding : Astlib.Ast_500.Parsetree.value_binding t| Module_binding : Astlib.Ast_500.Parsetree.module_binding t| Pstr_eval : Astlib.Ast_500.Parsetree.structure_item t| Pstr_extension : Astlib.Ast_500.Parsetree.structure_item t| Psig_extension : Astlib.Ast_500.Parsetree.signature_item t| Rtag : Astlib.Ast_500.Parsetree.row_field t| Object_type_field : Astlib.Ast_500.Parsetree.object_field t
val label_declaration : Astlib.Ast_500.Parsetree.label_declaration tval constructor_declaration :
- Astlib.Ast_500.Parsetree.constructor_declaration tval type_declaration : Astlib.Ast_500.Parsetree.type_declaration tval type_extension : Astlib.Ast_500.Parsetree.type_extension tval type_exception : Astlib.Ast_500.Parsetree.type_exception tval extension_constructor : Astlib.Ast_500.Parsetree.extension_constructor tval pattern : Astlib.Ast_500.Parsetree.pattern tval core_type : Astlib.Ast_500.Parsetree.core_type tval expression : Astlib.Ast_500.Parsetree.expression tval value_description : Astlib.Ast_500.Parsetree.value_description tval class_type : Astlib.Ast_500.Parsetree.class_type tval class_type_field : Astlib.Ast_500.Parsetree.class_type_field tval class_infos : _ Astlib.Ast_500.Parsetree.class_infos tval class_expr : Astlib.Ast_500.Parsetree.class_expr tval class_field : Astlib.Ast_500.Parsetree.class_field tval module_type : Astlib.Ast_500.Parsetree.module_type tval module_declaration : Astlib.Ast_500.Parsetree.module_declaration tval module_type_declaration :
+ Astlib.Ast_500.Parsetree.constructor_declaration tval type_declaration : Astlib.Ast_500.Parsetree.type_declaration tval type_extension : Astlib.Ast_500.Parsetree.type_extension tval type_exception : Astlib.Ast_500.Parsetree.type_exception tval extension_constructor : Astlib.Ast_500.Parsetree.extension_constructor tval pattern : Astlib.Ast_500.Parsetree.pattern tval core_type : Astlib.Ast_500.Parsetree.core_type tval expression : Astlib.Ast_500.Parsetree.expression tval value_description : Astlib.Ast_500.Parsetree.value_description tval class_type : Astlib.Ast_500.Parsetree.class_type tval class_type_field : Astlib.Ast_500.Parsetree.class_type_field tval class_infos : _ Astlib.Ast_500.Parsetree.class_infos tval class_expr : Astlib.Ast_500.Parsetree.class_expr tval class_field : Astlib.Ast_500.Parsetree.class_field tval class_type_decl :
+ Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos tval module_type : Astlib.Ast_500.Parsetree.module_type tval module_declaration : Astlib.Ast_500.Parsetree.module_declaration tval module_type_declaration :
Astlib.Ast_500.Parsetree.module_type_declaration tval open_description :
Astlib.Longident.t Astlib.Location.loc Astlib.Ast_500.Parsetree.open_infos tval include_infos : _ Astlib.Ast_500.Parsetree.include_infos tval module_expr : Astlib.Ast_500.Parsetree.module_expr tval value_binding : Astlib.Ast_500.Parsetree.value_binding tval module_binding : Astlib.Ast_500.Parsetree.module_binding tval pstr_eval : Astlib.Ast_500.Parsetree.structure_item tval pstr_extension : Astlib.Ast_500.Parsetree.structure_item tval psig_extension : Astlib.Ast_500.Parsetree.signature_item tval rtag : Astlib.Ast_500.Parsetree.row_field tval object_type_field : Astlib.Ast_500.Parsetree.object_field t
\ No newline at end of file
diff --git a/ppxlib/Ppxlib/Context_free/Rule/index.html b/ppxlib/Ppxlib/Context_free/Rule/index.html
index 0250431..09ead63 100644
--- a/ppxlib/Ppxlib/Context_free/Rule/index.html
+++ b/ppxlib/Ppxlib/Context_free/Rule/index.html
@@ -85,4 +85,20 @@
(Astlib.Ast_500.Parsetree.signature_item,
Astlib.Ast_500.Parsetree.type_exception,
_)
- attr_inline
\ No newline at end of file
+ attr_inlineval attr_str_class_type_decl :
+ (Astlib.Ast_500.Parsetree.structure_item,
+ Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos,
+ _)
+ attr_group_inlineval attr_sig_class_type_decl :
+ (Astlib.Ast_500.Parsetree.signature_item,
+ Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos,
+ _)
+ attr_group_inlineval attr_str_class_type_decl_expect :
+ (Astlib.Ast_500.Parsetree.structure_item,
+ Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos,
+ _)
+ attr_group_inlineval attr_sig_class_type_decl_expect :
+ (Astlib.Ast_500.Parsetree.signature_item,
+ Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos,
+ _)
+ attr_group_inline
\ No newline at end of file
diff --git a/ppxlib/Ppxlib/Deriving/index.html b/ppxlib/Ppxlib/Deriving/index.html
index dda4859..7c2154f 100644
--- a/ppxlib/Ppxlib/Deriving/index.html
+++ b/ppxlib/Ppxlib/Deriving/index.html
@@ -5,6 +5,11 @@
Astlib.Ast_500.Asttypes.rec_flag
* Astlib.Ast_500.Parsetree.type_declaration list)
Generator.t ->
+ ?str_class_type_decl:
+ (Astlib.Ast_500.Parsetree.structure_item list,
+ Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos
+ list)
+ Generator.t ->
?str_type_ext:
(Astlib.Ast_500.Parsetree.structure_item list,
Astlib.Ast_500.Parsetree.type_extension)
@@ -22,6 +27,11 @@
Astlib.Ast_500.Asttypes.rec_flag
* Astlib.Ast_500.Parsetree.type_declaration list)
Generator.t ->
+ ?sig_class_type_decl:
+ (Astlib.Ast_500.Parsetree.signature_item list,
+ Astlib.Ast_500.Parsetree.class_type Astlib.Ast_500.Parsetree.class_infos
+ list)
+ Generator.t ->
?sig_type_ext:
(Astlib.Ast_500.Parsetree.signature_item list,
Astlib.Ast_500.Parsetree.type_extension)
@@ -43,10 +53,12 @@
tRegister a new deriving generator.
The various arguments are for the various items on which derivers can be attached in structure and signatures.
We distinguish exception from type_extension as exception E is not exactly the same as type exn += E. Indeed if the type exn is redefined, then type exn += E will add E to the new exn type while exception E will add E to the predefined exn type.
extension register an expander for extension with the name of the deriver. This is here mostly to support the ppx_deriving backend.
val add_alias :
string ->
?str_type_decl:t list ->
+ ?str_class_type_decl:t list ->
?str_type_ext:t list ->
?str_exception:t list ->
?str_module_type_decl:t list ->
?sig_type_decl:t list ->
+ ?sig_class_type_decl:t list ->
?sig_type_ext:t list ->
?sig_exception:t list ->
?sig_module_type_decl:t list ->
diff --git a/ppxlib/Ppxlib/Pp_ast/Config/index.html b/ppxlib/Ppxlib/Pp_ast/Config/index.html
new file mode 100644
index 0000000..a7a60df
--- /dev/null
+++ b/ppxlib/Ppxlib/Pp_ast/Config/index.html
@@ -0,0 +1,7 @@
+
+Config (ppxlib.Ppxlib.Pp_ast.Config) Module Pp_ast.Config
\ No newline at end of file
diff --git a/ppxlib/Ppxlib/Pp_ast/Default/index.html b/ppxlib/Ppxlib/Pp_ast/Default/index.html
new file mode 100644
index 0000000..41a1f82
--- /dev/null
+++ b/ppxlib/Ppxlib/Pp_ast/Default/index.html
@@ -0,0 +1,2 @@
+
+Default (ppxlib.Ppxlib.Pp_ast.Default) Module Pp_ast.Default
type 'a printer = 'a configuredval structure : Astlib.Ast_500.Parsetree.structure_item list printerval structure_item : Astlib.Ast_500.Parsetree.structure_item printerval signature : Astlib.Ast_500.Parsetree.signature_item list printerval signature_item : Astlib.Ast_500.Parsetree.signature_item printerval expression : Astlib.Ast_500.Parsetree.expression printerval pattern : Astlib.Ast_500.Parsetree.pattern printerval core_type : Astlib.Ast_500.Parsetree.core_type printer
\ No newline at end of file
diff --git a/ppxlib/Ppxlib/Pp_ast/Make/argument-1-Conf/index.html b/ppxlib/Ppxlib/Pp_ast/Make/argument-1-Conf/index.html
new file mode 100644
index 0000000..333f2fa
--- /dev/null
+++ b/ppxlib/Ppxlib/Pp_ast/Make/argument-1-Conf/index.html
@@ -0,0 +1,2 @@
+
+Conf (ppxlib.Ppxlib.Pp_ast.Make.Conf) Parameter Make.Conf
val config : Config.t
\ No newline at end of file
diff --git a/ppxlib/Ppxlib/Pp_ast/Make/index.html b/ppxlib/Ppxlib/Pp_ast/Make/index.html
new file mode 100644
index 0000000..9ed35ca
--- /dev/null
+++ b/ppxlib/Ppxlib/Pp_ast/Make/index.html
@@ -0,0 +1,2 @@
+
+Make (ppxlib.Ppxlib.Pp_ast.Make) Module Pp_ast.Make
Parameters
Signature
type 'a printer = 'a configuredval structure : Astlib.Ast_500.Parsetree.structure_item list printerval structure_item : Astlib.Ast_500.Parsetree.structure_item printerval signature : Astlib.Ast_500.Parsetree.signature_item list printerval signature_item : Astlib.Ast_500.Parsetree.signature_item printerval expression : Astlib.Ast_500.Parsetree.expression printerval pattern : Astlib.Ast_500.Parsetree.pattern printerval core_type : Astlib.Ast_500.Parsetree.core_type printer
\ No newline at end of file
diff --git a/ppxlib/Ppxlib/Pp_ast/index.html b/ppxlib/Ppxlib/Pp_ast/index.html
new file mode 100644
index 0000000..e6ec3ee
--- /dev/null
+++ b/ppxlib/Ppxlib/Pp_ast/index.html
@@ -0,0 +1,7 @@
+
+Pp_ast (ppxlib.Ppxlib.Pp_ast) Module Ppxlib.Pp_ast
This module implements pretty printers for the OCaml AST's version used by ppxlib.
Those pretty printers show the AST as its OCaml representation and do not pretty print the corresponding source code. For printing ASTs as source code use the Ppxlib.Pprintast module instead.
For example, calling Pp_ast.expression Format.std_formatter [%expr x + 2] will print:
Pexp_apply
+ ( Pexp_ident (Lident "+")
+ , [ ( Nolabel, Pexp_ident (Lident "x"))
+ ; ( Nolabel, Pexp_constant (Pconst_integer ( "2", None)))
+ ]
+ )
To keep the output easily readable, records with _desc fields such as Ppxlib.Ast.expression or Ppxlib.Ast.pattern are not printed as such and only the value of the corresponding _desc field is printed instead. This prevents AST nodes metadata, such as locations or attributes, from polluting the output, keeping it relatively concise and clean. The same goes for Location.loc values which are printed as the value of their txt field.
Location.t and Ppxlib.Ast.attributes are not displayed by default even outside of the records mentioned above.
The Config module below allows to override part or all of this behaviour. When configured to display locations or attributes, the entire record will be displayed, not only its _desc field.
module Config : sig ... endtype 'a pp = Stdlib.Format.formatter -> 'a -> unittype 'a configured = 'a ppmodule type S = sig ... endmodule type Conf = sig ... endmodule type Configured = S with type 'a printer = 'a configuredmodule type Configurable = S with type 'a printer = 'a configurablemodule Make (Conf : Conf) : Configuredval make : Config.t -> (module Configured)module Default : Configuredinclude Configurable
type 'a printer = 'a configurableval structure : Astlib.Ast_500.Parsetree.structure_item list printerval structure_item : Astlib.Ast_500.Parsetree.structure_item printerval signature : Astlib.Ast_500.Parsetree.signature_item list printerval signature_item : Astlib.Ast_500.Parsetree.signature_item printerval expression : Astlib.Ast_500.Parsetree.expression printerval pattern : Astlib.Ast_500.Parsetree.pattern printerval core_type : Astlib.Ast_500.Parsetree.core_type printer
\ No newline at end of file
diff --git a/ppxlib/Ppxlib/Pp_ast/module-type-Conf/index.html b/ppxlib/Ppxlib/Pp_ast/module-type-Conf/index.html
new file mode 100644
index 0000000..e84ef0d
--- /dev/null
+++ b/ppxlib/Ppxlib/Pp_ast/module-type-Conf/index.html
@@ -0,0 +1,2 @@
+
+Conf (ppxlib.Ppxlib.Pp_ast.Conf) Module type Pp_ast.Conf
val config : Config.t
\ No newline at end of file
diff --git a/ppxlib/Ppxlib/Pp_ast/module-type-Configurable/index.html b/ppxlib/Ppxlib/Pp_ast/module-type-Configurable/index.html
new file mode 100644
index 0000000..f43aebe
--- /dev/null
+++ b/ppxlib/Ppxlib/Pp_ast/module-type-Configurable/index.html
@@ -0,0 +1,2 @@
+
+Configurable (ppxlib.Ppxlib.Pp_ast.Configurable) Module type Pp_ast.Configurable
type 'a printer = 'a configurableval structure : Astlib.Ast_500.Parsetree.structure_item list printerval structure_item : Astlib.Ast_500.Parsetree.structure_item printerval signature : Astlib.Ast_500.Parsetree.signature_item list printerval signature_item : Astlib.Ast_500.Parsetree.signature_item printerval expression : Astlib.Ast_500.Parsetree.expression printerval pattern : Astlib.Ast_500.Parsetree.pattern printerval core_type : Astlib.Ast_500.Parsetree.core_type printer
\ No newline at end of file
diff --git a/ppxlib/Ppxlib/Pp_ast/module-type-Configured/index.html b/ppxlib/Ppxlib/Pp_ast/module-type-Configured/index.html
new file mode 100644
index 0000000..0d16795
--- /dev/null
+++ b/ppxlib/Ppxlib/Pp_ast/module-type-Configured/index.html
@@ -0,0 +1,2 @@
+
+Configured (ppxlib.Ppxlib.Pp_ast.Configured) Module type Pp_ast.Configured
type 'a printer = 'a configuredval structure : Astlib.Ast_500.Parsetree.structure_item list printerval structure_item : Astlib.Ast_500.Parsetree.structure_item printerval signature : Astlib.Ast_500.Parsetree.signature_item list printerval signature_item : Astlib.Ast_500.Parsetree.signature_item printerval expression : Astlib.Ast_500.Parsetree.expression printerval pattern : Astlib.Ast_500.Parsetree.pattern printerval core_type : Astlib.Ast_500.Parsetree.core_type printer
\ No newline at end of file
diff --git a/ppxlib/Ppxlib/Pp_ast/module-type-S/index.html b/ppxlib/Ppxlib/Pp_ast/module-type-S/index.html
new file mode 100644
index 0000000..86254ae
--- /dev/null
+++ b/ppxlib/Ppxlib/Pp_ast/module-type-S/index.html
@@ -0,0 +1,2 @@
+
+S (ppxlib.Ppxlib.Pp_ast.S) Module type Pp_ast.S
val structure : Astlib.Ast_500.Parsetree.structure_item list printerval structure_item : Astlib.Ast_500.Parsetree.structure_item printerval signature : Astlib.Ast_500.Parsetree.signature_item list printerval signature_item : Astlib.Ast_500.Parsetree.signature_item printerval expression : Astlib.Ast_500.Parsetree.expression printerval pattern : Astlib.Ast_500.Parsetree.pattern printerval core_type : Astlib.Ast_500.Parsetree.core_type printer
\ No newline at end of file
diff --git a/ppxlib/Ppxlib/index.html b/ppxlib/Ppxlib/index.html
index 5b24506..5f4c0e5 100644
--- a/ppxlib/Ppxlib/index.html
+++ b/ppxlib/Ppxlib/index.html
@@ -1,5 +1,5 @@
-Ppxlib (ppxlib.Ppxlib) Module Ppxlib
Standard library for ppx rewriters
ppxlib is meant to be opened globally in your PPX source files.
Opening it comes with two advantages. First, it will shadow the compiler-libs modules. The compiler-libs modules are unstable and aren't meant to be used, so shadowing them is a good protection mechanism. In case you don't want to open Ppxlib, you can open Ocaml_shadow to get the same protection. Second, it will bring several modules in scope, that are useful to have when writing a rewriter:
- The main
ppxlib modules, such as modules to help manipulate the AST (Ast_builder, Ast_pattern), and a few functions. - Modules from other libraries, such as
Ast_helper or Pprintast, - The whole AST types (by
including the Ast module).
The core ppxlib entries
Manipulating the AST
module Ast_builder : sig ... endAst_builder is a module to generate OCaml AST fragments. It provides a shorter syntax than directly using the Parsetree constructors, as well as a better stability than the constructors.
module Ast_pattern : sig ... endThis module implements first class AST patterns. It allows to destruct and extract values from AST fragments. This gives the same functionality as a pattern-match, but with simpler syntax and more stability than directly pattern-matching on the Parsetree constructors.
module Ast_traverse : sig ... endThis module provides AST traversal classes, such as maps, iterations, folds, etc. on the Parsetree types.
Context-free rewriting
module Context_free : sig ... endContext free rewriting, to define local rewriting rules that will all be applied at once by the driver.
module Deriving : sig ... endDeriving code from type declarations.
module Extension : sig ... endDeclare extenders to rewrite extension nodes.
module Expansion_context : sig ... endThe context given to rewriting rules when expanding.
module Code_path : sig ... endThis module contains type and functions for representing and manipulating path to AST nodes.
Other helpers
module Expansion_helpers : sig ... endVarious helpers for expansion, such as quoting expressions in their context, or mangling names.
module Merlin_helpers : sig ... endSome helpers to annotate the AST so merlin can decide which branches to look at and which branches to ignore.
module Spellcheck : sig ... endHelpers to provide hints to PPX users for typos or spellchecks.
module Keyword : sig ... endSmall module to check if a string is an OCaml keyword.
Driver-related modules
module Driver : sig ... endInteraction with the driver, such as getting/seeting cookies, adding arguments.
module Caller_id : sig ... endSmall helper to find out who is the caller of a function
module Ast_io : sig ... endA small module to help read bin-annots generated files.
Checks
module Attribute : sig ... endThis module provides hygiene for attributes. The goal is to report misuses of attributes to the user as soon as possible so that no mistyped attribute get silently ignored.
module Reserved_namespaces : sig ... endSmall module to reserve namespaces in attribute names.
Common helper functions
val lident : string -> Longident.tval core_type_of_type_declaration :
+Ppxlib (ppxlib.Ppxlib) Module Ppxlib
Standard library for ppx rewriters
ppxlib is meant to be opened globally in your PPX source files.
Opening it comes with two advantages. First, it will shadow the compiler-libs modules. The compiler-libs modules are unstable and aren't meant to be used, so shadowing them is a good protection mechanism. In case you don't want to open Ppxlib, you can open Ocaml_shadow to get the same protection. Second, it will bring several modules in scope, that are useful to have when writing a rewriter:
- The main
ppxlib modules, such as modules to help manipulate the AST (Ast_builder, Ast_pattern), and a few functions. - Modules from other libraries, such as
Ast_helper or Pprintast, - The whole AST types (by
including the Ast module).
The core ppxlib entries
Manipulating the AST
module Ast_builder : sig ... endAst_builder is a module to generate OCaml AST fragments. It provides a shorter syntax than directly using the Parsetree constructors, as well as a better stability than the constructors.
module Ast_pattern : sig ... endThis module implements first class AST patterns. It allows to destruct and extract values from AST fragments. This gives the same functionality as a pattern-match, but with simpler syntax and more stability than directly pattern-matching on the Parsetree constructors.
module Ast_traverse : sig ... endThis module provides AST traversal classes, such as maps, iterations, folds, etc. on the Parsetree types.
Context-free rewriting
module Context_free : sig ... endContext free rewriting, to define local rewriting rules that will all be applied at once by the driver.
module Deriving : sig ... endDeriving code from type declarations.
module Extension : sig ... endDeclare extenders to rewrite extension nodes.
module Expansion_context : sig ... endThe context given to rewriting rules when expanding.
module Code_path : sig ... endThis module contains type and functions for representing and manipulating path to AST nodes.
Other helpers
module Expansion_helpers : sig ... endVarious helpers for expansion, such as quoting expressions in their context, or mangling names.
module Merlin_helpers : sig ... endSome helpers to annotate the AST so merlin can decide which branches to look at and which branches to ignore.
module Spellcheck : sig ... endHelpers to provide hints to PPX users for typos or spellchecks.
module Keyword : sig ... endSmall module to check if a string is an OCaml keyword.
module Pp_ast : sig ... endThis module implements pretty printers for the OCaml AST's version used by ppxlib.
Driver-related modules
module Driver : sig ... endInteraction with the driver, such as getting/seeting cookies, adding arguments.
module Caller_id : sig ... endSmall helper to find out who is the caller of a function
module Ast_io : sig ... endA small module to help read bin-annots generated files.
Checks
module Attribute : sig ... endThis module provides hygiene for attributes. The goal is to report misuses of attributes to the user as soon as possible so that no mistyped attribute get silently ignored.
module Reserved_namespaces : sig ... endSmall module to reserve namespaces in attribute names.
Common helper functions
val lident : string -> Longident.tval core_type_of_type_declaration :
Astlib.Ast_500.Parsetree.type_declaration ->
Astlib.Ast_500.Parsetree.core_typeval name_type_params_in_td_res :
Astlib.Ast_500.Parsetree.type_declaration ->
diff --git a/ppxlib/Ppxlib__Pp_ast/index.html b/ppxlib/Ppxlib__Pp_ast/index.html
new file mode 100644
index 0000000..c0d935b
--- /dev/null
+++ b/ppxlib/Ppxlib__Pp_ast/index.html
@@ -0,0 +1,2 @@
+
+Ppxlib__Pp_ast (ppxlib.Ppxlib__Pp_ast) Module Ppxlib__Pp_ast
\ No newline at end of file
diff --git a/ppxlib/Ppxlib_traverse/Backends/class-reconstructors/index.html b/ppxlib/Ppxlib_traverse/Backends/class-reconstructors/index.html
index 9a89274..3cc46bc 100644
--- a/ppxlib/Ppxlib_traverse/Backends/class-reconstructors/index.html
+++ b/ppxlib/Ppxlib_traverse/Backends/class-reconstructors/index.html
@@ -1,12 +1,13 @@
reconstructors (ppxlib.Ppxlib_traverse.Backends.reconstructors) Class Backends.reconstructors
method record : reconstructors ->
- loc:Ppxlib__.Import.location ->
- (Ppxlib__.Import.longident_loc * Ppxlib__.Import.expression) list ->
+ loc:Ppxlib__.Location.t ->
+ (Ppxlib__.Import.longident Ppxlib__.Import.loc * Ppxlib__.Import.expression)
+ list ->
Ppxlib__.Import.expression
\ No newline at end of file
diff --git a/ppxlib/Ppxlib_traverse/index.html b/ppxlib/Ppxlib_traverse/index.html
index 8c477b4..16ada9a 100644
--- a/ppxlib/Ppxlib_traverse/index.html
+++ b/ppxlib/Ppxlib_traverse/index.html
@@ -10,7 +10,7 @@
string Ppxlib.loc list ->
Astlib.Ast_500.Parsetree.core_type listval fst_expr : loc:Ppxlib.location -> Ppxlib.expression -> Ppxlib.expressionval snd_expr : loc:Ppxlib.location -> Ppxlib.expression -> Ppxlib.expressionval methods_of_class_exn : Ppxlib.structure_item -> Ppxlib.class_field listmodule Backends : sig ... endtype what = Backends.whatval mapper_type :
what:what ->
- loc:Astlib.Location.t ->
+ loc:Ppxlib.Location.t ->
Astlib.Longident.t Astlib.Location.loc ->
Ppxlib.core_type Stdppx.List.t ->
Astlib.Ast_500.Parsetree.core_typeval constrained_mapper :
@@ -27,13 +27,13 @@
Ppxlib.core_type list ->
(string Ppxlib.loc * Ppxlib.expression) listval gen_record' :
what:what ->
- loc:Astlib.Location.t ->
+ loc:Ppxlib.Location.t ->
Ppxlib.label_declaration list ->
Astlib.Ast_500.Parsetree.pattern
* Astlib.Ast_500.Parsetree.expression
* (string Ppxlib.loc * Ppxlib.expression) listval gen_record :
what:what ->
- loc:Astlib.Location.t ->
+ loc:Ppxlib.Location.t ->
Ppxlib.label_declaration list ->
Ppxlib.expressionval is_constant_constructor : Ppxlib.constructor_declaration -> boolval erase_type_variables : Ppxlib.Ast_traverse.mapval gen_variant :
what:what ->
diff --git a/ppxlib/_doc-dir/CHANGES.md b/ppxlib/_doc-dir/CHANGES.md
index 41933b9..a87c3f4 100644
--- a/ppxlib/_doc-dir/CHANGES.md
+++ b/ppxlib/_doc-dir/CHANGES.md
@@ -1,3 +1,42 @@
+0.34.0 (2025-01-06)
+-------------------
+
+### 5.3 support
+
+5.3 support is being added gradually over the course of its development.
+This section should be updated with each relevant PR.
+
+Note to maintainers: until 5.3 support is officially released, this section
+should be excluded from the release, see [RELEASING.md](RELEASING.md) for
+details.
+
+- Add initial OCaml 5.3 support (#487, @NathanReb, @hhugo, @nojb)
+
+- Initialise OCaml 5.3's lexer with the `keywords` setting from `OCAMLPARAM` or
+ the new `-keywords` driver's CLI option to allow the standalone ppx driver to
+ process old packages using `effect` as an identifier
+ (#535, @dra27, @NathanReb)
+
+### Other changes
+
+- Add `Pprintast.binding`, `longident` and `payload` (#542, @mattiasdrp)
+
+- Fix `deriving_inline` round-trip check so that it works with 5.01 <-> 5.02
+ migrations (#519, @NathanReb)
+
+- Add ppxlib's AST pretty-printing utilities in `Ppxlib.Pp_ast` and
+ a `ppxlib-pp-ast` executable in a new separate `ppxlib-tools` package
+ (#517, #525, #537, @NathanReb)
+
+- Change `-dparsetree` from a sexp output to a pretty printed AST, closer
+ to what the compiler's `-dparsetree` is.
+ (#530, @NathanReb)
+
+- Add Parsetree documentation comments to `Ast_builder` functions (#518, @patricoferris)
+
+- Support class type declarations in derivers with the new, optional arguments
+ `{str,sig}_class_type_decl` in `Deriving.add` (#538, @patricoferris)
+
0.33.0 (2024-07-22)
-------------------
diff --git a/ppxlib/_doc-dir/odoc-pages/writing-ppxs.mld b/ppxlib/_doc-dir/odoc-pages/writing-ppxs.mld
index c8dba83..ff67a65 100644
--- a/ppxlib/_doc-dir/odoc-pages/writing-ppxs.mld
+++ b/ppxlib/_doc-dir/odoc-pages/writing-ppxs.mld
@@ -448,8 +448,6 @@ Global transformations are the most general kind of transformation. As such, the
factorised, resulting in slower compilation time.
- If you don't make sure that you really follow all {{!"good-practices"}good practices}, you might end up messing up the global developer experience.
-- If you don't make sure that you really follow all {{!"good-practices"}good practices}, you might end up messing up the global developer experience.
-
For all these reasons, a global transformation should be avoided whenever a
context-free transformation could do the job, which by experience seems to be most of the time.
The API for defining a global transformation is easy. A global transformation consists simply of the function and can be directly be registered with {{!Ppxlib.Driver.register_transformation}[Driver.register_transformation]}.
diff --git a/ppxlib/writing-ppxs.html b/ppxlib/writing-ppxs.html
index 436834f..6960ccf 100644
--- a/ppxlib/writing-ppxs.html
+++ b/ppxlib/writing-ppxs.html
@@ -57,7 +57,7 @@ val rule : Context_free.Rule.t = <abstr>
# Driver.register_transformation ~rules:[ rule ] "special_function_demo" ;;
- : unit = ()With such a rewriter registered:
# Printf.printf "n_args is applied with %d arguments\n" (n_args ignored "arguments");;
n_args is applied with 2 arguments
-- : unit = ()
Global transformation
Global transformations are the most general kind of transformation. As such, they allow doing virtually any modifications, but this comes with several drawbacks. There are very few PPXs that really need this powerful but dangerous feature. In fact, even if, at first sight, it seems like your transformation isn't context-free, it's likely that you can find a more suitable abstraction with which it becomes context-free. Whenever that's the case, go for context-free! The mentioned drawbacks are:
- It is harder for the user to know exactly what parts of the AST will be changed. Your transformation becomes a scary black box.
- It is harder for
ppxlib to combine several global transformations, as there is no guarantee that the effect of one will work well with the effect of another. - The job done by two global transformations (e.g., an AST traverse) cannot be factorised, resulting in slower compilation time.
- If you don't make sure that you really follow all good practices, you might end up messing up the global developer experience.
- If you don't make sure that you really follow all good practices, you might end up messing up the global developer experience.
For all these reasons, a global transformation should be avoided whenever a context-free transformation could do the job, which by experience seems to be most of the time. The API for defining a global transformation is easy. A global transformation consists simply of the function and can be directly be registered with Driver.register_transformation.
# let f str = List.filter (fun _ -> Random.bool ()) str;; (* Randomly omit structure items *)
+- : unit = ()
Global transformation
Global transformations are the most general kind of transformation. As such, they allow doing virtually any modifications, but this comes with several drawbacks. There are very few PPXs that really need this powerful but dangerous feature. In fact, even if, at first sight, it seems like your transformation isn't context-free, it's likely that you can find a more suitable abstraction with which it becomes context-free. Whenever that's the case, go for context-free! The mentioned drawbacks are:
- It is harder for the user to know exactly what parts of the AST will be changed. Your transformation becomes a scary black box.
- It is harder for
ppxlib to combine several global transformations, as there is no guarantee that the effect of one will work well with the effect of another. - The job done by two global transformations (e.g., an AST traverse) cannot be factorised, resulting in slower compilation time.
- If you don't make sure that you really follow all good practices, you might end up messing up the global developer experience.
For all these reasons, a global transformation should be avoided whenever a context-free transformation could do the job, which by experience seems to be most of the time. The API for defining a global transformation is easy. A global transformation consists simply of the function and can be directly be registered with Driver.register_transformation.
# let f str = List.filter (fun _ -> Random.bool ()) str;; (* Randomly omit structure items *)
val f : 'a list -> 'a list = <fun>
# Driver.register_transformation ~impl:f "absent_minded_transformation"
- : unit = ()
Inlining Transformations
When using a PPX, the transformation happens at compile time, and the produced code could be directly inlined into the original code. This allows dropping the dependency on ppxlib and the PPX used to generate the code.
This mechanism is implemented for derivers implemented in ppxlib and is convenient to use, especially in conjunction with Dune. When applying a deriver, using [@@deriving_inline deriver_name] will apply the inline mode of deriver_name instead of the normal mode.
Inline derivers will generate a .corrected version of the file that Dune can use to promote your file. For more information on how to use this feature to remove a dependency on ppxlib and a specific PPX from your project, refer to this guide.
Integration with Dune
If your PPX is written as a Dune project, you'll need to specify the kind field in your dune file with one of the following two values:
ppx_rewriter, orppx_deriver.
If your transformation is anything but a deriver (e.g. an extension node rewriter), use ppx_rewriter. If your transformation is a deriver, then the TLDR workflow is: use ppx_deriver and furthermore add ppx_deriving to your dependencies, i.e. to the libraries field of your dune file. In fact, the situation is quite a bit more complex, though: apart from applying the registered transformations, the Ppxlib driver also does several checks. One of those consists in checking the following: whenever the source code contains [@@deriving foo (...)], then the Ppxlib driver expects a driver named foo to be registered. That's helpful to catch typos and missing dependencies on derivers and is certainly more hygienic than silently ignoring the annotation. However, for that check to work, the registered derivers must be grouped together into one process, i.e. a driver. UTop cannot use a static driver such as the Ppxlib one because dependencies are added dynamically to a UTop session. So the solution is the following: if you use ppx_deriver in your kind field, dune will add the right data to your PPXs META file to ensure that UTop will use the ppx_deriving driver, which links the derivers dynamically. As a result, ppx_derivng appears as a dependency in the META file. Therefore, whenever a user uses ocamlfind (e.g. by using UTop), they will hit an "ppx_derivng not found" error, unless you define ppx_deriving in your dependencies. So, long story short: if you strongly care about avoiding ppx_deriving as a dependency, use ppx_rewriter in your kind field and be aware of the fact that users won't be able to try your deriver in UTop; otherwise do the TLDR workflow.
Here is a minimal Dune stanza for a rewriter:
(library
diff --git a/trace-fuchsia/_doc-dir/CHANGES.md b/trace-fuchsia/_doc-dir/CHANGES.md
index 2721a13..a563d37 100644
--- a/trace-fuchsia/_doc-dir/CHANGES.md
+++ b/trace-fuchsia/_doc-dir/CHANGES.md
@@ -1,3 +1,7 @@
+# 0.9
+
+- add an extensible sum type, so users can implement custom events. For example
+ an OTEL collector can provide custom events to link two spans to one another.
# 0.8
diff --git a/trace-tef/_doc-dir/CHANGES.md b/trace-tef/_doc-dir/CHANGES.md
index 2721a13..a563d37 100644
--- a/trace-tef/_doc-dir/CHANGES.md
+++ b/trace-tef/_doc-dir/CHANGES.md
@@ -1,3 +1,7 @@
+# 0.9
+
+- add an extensible sum type, so users can implement custom events. For example
+ an OTEL collector can provide custom events to link two spans to one another.
# 0.8
diff --git a/trace/Trace/index.html b/trace/Trace/index.html
index 5967f63..036b742 100644
--- a/trace/Trace/index.html
+++ b/trace/Trace/index.html
@@ -54,4 +54,4 @@
?data:(unit -> (string * user_data) list) ->
string ->
float ->
- unit
Emit a counter of type float. See counter_int for more details.
Collector
type collector = (module Collector.S)An event collector.
See Collector for more details.
val setup_collector : collector -> unitsetup_collector c installs c as the current collector.
val get_current_level : unit -> Level.tGet current level. This is only meaningful if a collector was set up with setup_collector.
val set_current_level : Level.t -> unitSet the current level of tracing. This only has a visible effect if a collector was installed with setup_collector.
shutdown () shutdowns the current collector, if one was installed, and waits for it to terminate before returning.
Extensions
val extension_event : extension_event -> unitTrigger an extension event, whose meaning depends on the library that defines it. Some collectors will simply ignore it. This does nothing if no collector is setup.
\ No newline at end of file
+ unitEmit a counter of type float. See counter_int for more details.
Collector
type collector = (module Collector.S)An event collector.
See Collector for more details.
val setup_collector : collector -> unitsetup_collector c installs c as the current collector.
val get_current_level : unit -> Level.tGet current level. This is only meaningful if a collector was set up with setup_collector.
val set_current_level : Level.t -> unitSet the current level of tracing. This only has a visible effect if a collector was installed with setup_collector.
shutdown () shutdowns the current collector, if one was installed, and waits for it to terminate before returning.
Extensions
val extension_event : extension_event -> unitTrigger an extension event, whose meaning depends on the library that defines it. Some collectors will simply ignore it. This does nothing if no collector is setup.
\ No newline at end of file
diff --git a/trace/Trace_core/Collector/module-type-S/index.html b/trace/Trace_core/Collector/module-type-S/index.html
index fe0c26c..22e28d5 100644
--- a/trace/Trace_core/Collector/module-type-S/index.html
+++ b/trace/Trace_core/Collector/module-type-S/index.html
@@ -92,4 +92,4 @@
list ->
string ->
float ->
- unitFloat counter.
Handle an extension event. A collector MUST simple ignore events it doesn't know, and return () silently.
\ No newline at end of file
+ unitFloat counter.
Handle an extension event. A collector MUST simple ignore events it doesn't know, and return () silently.
\ No newline at end of file
diff --git a/trace/Trace_core/index.html b/trace/Trace_core/index.html
index ba41ffa..1ba36f3 100644
--- a/trace/Trace_core/index.html
+++ b/trace/Trace_core/index.html
@@ -54,4 +54,4 @@
?data:(unit -> (string * user_data) list) ->
string ->
float ->
- unitEmit a counter of type float. See counter_int for more details.
Collector
type collector = (module Collector.S)An event collector.
See Collector for more details.
val setup_collector : collector -> unitsetup_collector c installs c as the current collector.
val get_current_level : unit -> Level.tGet current level. This is only meaningful if a collector was set up with setup_collector.
val set_current_level : Level.t -> unitSet the current level of tracing. This only has a visible effect if a collector was installed with setup_collector.
shutdown () shutdowns the current collector, if one was installed, and waits for it to terminate before returning.
Extensions
val extension_event : extension_event -> unitTrigger an extension event, whose meaning depends on the library that defines it. Some collectors will simply ignore it. This does nothing if no collector is setup.
\ No newline at end of file
+ unitEmit a counter of type float. See counter_int for more details.
Collector
type collector = (module Collector.S)An event collector.
See Collector for more details.
val setup_collector : collector -> unitsetup_collector c installs c as the current collector.
val get_current_level : unit -> Level.tGet current level. This is only meaningful if a collector was set up with setup_collector.
val set_current_level : Level.t -> unitSet the current level of tracing. This only has a visible effect if a collector was installed with setup_collector.
shutdown () shutdowns the current collector, if one was installed, and waits for it to terminate before returning.
Extensions
val extension_event : extension_event -> unitTrigger an extension event, whose meaning depends on the library that defines it. Some collectors will simply ignore it. This does nothing if no collector is setup.
\ No newline at end of file
diff --git a/trace/Trace_subscriber/Callbacks/module-type-S/index.html b/trace/Trace_subscriber/Callbacks/module-type-S/index.html
index 9868ca6..fd1c842 100644
--- a/trace/Trace_subscriber/Callbacks/module-type-S/index.html
+++ b/trace/Trace_subscriber/Callbacks/module-type-S/index.html
@@ -54,4 +54,4 @@
time_ns:float ->
tid:int ->
Trace_core.extension_event ->
- unitExtension event
Extension event