To focus the search input from anywhere on the page, press the 'S' key.
in-package search v0.1.0
-
bigarray
-
dynlink
-
ocamlbytecomp
-
ocamlcommon
-
ocamlmiddleend
-
ocamloptcomp
-
odoc_info
-
raw_spacetime_lib
-
-
stdlib
-
str
-
threads
-
unix
Library
Module
Module type
Parameter
Class
Class type
Abstract syntax tree after typing
By comparison with Parsetree
:
- Every
Longindent
.t is accompanied by a resolvedPath.t
.
Extension points
type attribute = Parsetree.attribute
type attributes = attribute list
Core language
type _ pattern_category =
| Value : value pattern_category
| Computation : computation pattern_category
type pattern = value general_pattern
and 'k general_pattern = 'k pattern_desc pattern_data
and 'a pattern_data = {
pat_desc : 'a;
pat_loc : Location.t;
pat_extra : (pat_extra * Location.t * attributes) list;
pat_type : Types.type_expr;
pat_env : Env.t;
pat_attributes : attributes;
}
and pat_extra =
| Tpat_constraint of core_type
(*P : T
*)pat_desc = P ; pat_extra = (Tpat_constraint T, _, _) :: ...
| Tpat_type of Path.t * Longident.t Asttypes.loc
(*#tconst
pat_desc = disjunction ; pat_extra = (Tpat_type (P, "tconst"), _, _) :: ...
where
*)disjunction
is aTpat_or _
representing the branches oftconst
.| Tpat_open of Path.t * Longident.t Asttypes.loc * Env.t
| Tpat_unpack
(*(module P)
*)pat_desc = Tpat_var "P" ; pat_extra = (Tpat_unpack, _, _) :: ...
and 'k pattern_desc =
| Tpat_any : value pattern_desc
(*_
*)| Tpat_var : Ident.t * string Asttypes.loc -> value pattern_desc
(*x
*)| Tpat_alias : value general_pattern * Ident.t * string Asttypes.loc -> value pattern_desc
(*P as a
*)| Tpat_constant : Asttypes.constant -> value pattern_desc
(*1, 'a', "true", 1.0, 1l, 1L, 1n
*)| Tpat_tuple : value general_pattern list -> value pattern_desc
(*(P1, ..., Pn)
Invariant: n >= 2
*)| Tpat_construct : Longident.t Asttypes.loc * Types.constructor_description * value general_pattern list -> value pattern_desc
(*C C P
*)P
C (P1, ..., Pn)P1; ...; Pn
| Tpat_variant : Asttypes.label * value general_pattern option * Types.row_desc ref -> value pattern_desc
| Tpat_record : (Longident.t Asttypes.loc * Types.label_description * value general_pattern) list * Asttypes.closed_flag -> value pattern_desc
(*l1=P1; ...; ln=Pn
(flag = Closed)l1=P1; ...; ln=Pn; _
(flag = Open)Invariant: n > 0
*)| Tpat_array : value general_pattern list -> value pattern_desc
(*
*)| P1; ...; Pn |
| Tpat_lazy : value general_pattern -> value pattern_desc
(*lazy P
*)| Tpat_value : tpat_value_argument -> computation pattern_desc
(*P
Invariant: Tpat_value pattern should not carry pat_attributes or pat_extra metadata coming from user syntax, which must be on the inner pattern node -- to facilitate searching for a certain value pattern constructor with a specific attributed.
To enforce this restriction, we made the argument of the Tpat_value constructor a private synonym of
*)pattern
, requiring you to use theas_computation_pattern
function below instead of using theTpat_value
constructor directly.| Tpat_exception : value general_pattern -> computation pattern_desc
(*exception P
*)| Tpat_or : 'k general_pattern * 'k general_pattern * Types.row_desc option -> 'k pattern_desc
(*P1 | P2
*)row_desc
=Some _
when translatingPpat_type _
,None
otherwise.
and tpat_value_argument = private value general_pattern
and expression = {
exp_desc : expression_desc;
exp_loc : Location.t;
exp_extra : (exp_extra * Location.t * attributes) list;
exp_type : Types.type_expr;
exp_env : Env.t;
exp_attributes : attributes;
}