From 2c1097d19b003e49482fa642339cf25525a937f2 Mon Sep 17 00:00:00 2001 From: c-cube Date: Mon, 26 Aug 2024 14:16:27 +0000 Subject: [PATCH] deploy: 57aec09be95fa9392446ba2f22bc714f6e599cc9 --- ppxlib/Astlib/Ast_502/Asttypes/index.html | 2 + ppxlib/Astlib/Ast_502/Config/index.html | 2 + ppxlib/Astlib/Ast_502/Parsetree/index.html | 25 +++ ppxlib/Astlib/Ast_502/index.html | 2 + ppxlib/Astlib/Ast_503/Asttypes/index.html | 2 + ppxlib/Astlib/Ast_503/Config/index.html | 2 + ppxlib/Astlib/Ast_503/Parsetree/index.html | 25 +++ ppxlib/Astlib/Ast_503/index.html | 2 + ppxlib/Astlib/Location/index.html | 2 +- ppxlib/Astlib/Migrate_501_502/index.html | 154 ++++++++++++++++++ ppxlib/Astlib/Migrate_502_501/index.html | 154 ++++++++++++++++++ ppxlib/Astlib/Migrate_502_503/index.html | 152 +++++++++++++++++ ppxlib/Astlib/Migrate_503_502/index.html | 153 +++++++++++++++++ ppxlib/Astlib/index.html | 2 +- ppxlib/Astlib__Ast_502/index.html | 2 + ppxlib/Astlib__Ast_503/index.html | 2 + ppxlib/Astlib__Migrate_501_502/index.html | 2 + ppxlib/Astlib__Migrate_502_501/index.html | 2 + ppxlib/Astlib__Migrate_502_503/index.html | 2 + ppxlib/Astlib__Migrate_503_502/index.html | 2 + ppxlib/Ppxlib/Ast_builder/Default/index.html | 14 +- ppxlib/Ppxlib/Ast_builder/Make/index.html | 12 +- .../Ast_builder/module-type-S/index.html | 12 +- ppxlib/Ppxlib/Context_free/Rule/index.html | 6 +- ppxlib/Stdppx/index.html | 2 +- ppxlib/_doc-dir/CHANGES.md | 44 +++++ ppxlib/_doc-dir/README.md | 4 +- ppxlib/_doc-dir/odoc-pages/driver.mld | 19 ++- ppxlib/driver.html | 18 +- sexplib0/Sexplib0/Sexp_conv/index.html | 2 +- sexplib0/Sexplib0/Sexp_conv_error/index.html | 2 +- .../Sexp_conv_labeled_tuple/Fields/index.html | 2 + .../Sexp_conv_labeled_tuple/index.html | 7 + sexplib0/Sexplib0/index.html | 2 +- .../index.html | 2 + sexplib0/_doc-dir/CHANGES.md | 11 ++ sexplib0/_doc-dir/LICENSE.md | 2 +- trace-tef/Trace_tef__/index.html | 2 + trace-tef/Trace_tef__Event/index.html | 2 + trace-tef/Trace_tef_tldrs/index.html | 2 + trace-tef/index.html | 2 +- 41 files changed, 837 insertions(+), 23 deletions(-) create mode 100644 ppxlib/Astlib/Ast_502/Asttypes/index.html create mode 100644 ppxlib/Astlib/Ast_502/Config/index.html create mode 100644 ppxlib/Astlib/Ast_502/Parsetree/index.html create mode 100644 ppxlib/Astlib/Ast_502/index.html create mode 100644 ppxlib/Astlib/Ast_503/Asttypes/index.html create mode 100644 ppxlib/Astlib/Ast_503/Config/index.html create mode 100644 ppxlib/Astlib/Ast_503/Parsetree/index.html create mode 100644 ppxlib/Astlib/Ast_503/index.html create mode 100644 ppxlib/Astlib/Migrate_501_502/index.html create mode 100644 ppxlib/Astlib/Migrate_502_501/index.html create mode 100644 ppxlib/Astlib/Migrate_502_503/index.html create mode 100644 ppxlib/Astlib/Migrate_503_502/index.html create mode 100644 ppxlib/Astlib__Ast_502/index.html create mode 100644 ppxlib/Astlib__Ast_503/index.html create mode 100644 ppxlib/Astlib__Migrate_501_502/index.html create mode 100644 ppxlib/Astlib__Migrate_502_501/index.html create mode 100644 ppxlib/Astlib__Migrate_502_503/index.html create mode 100644 ppxlib/Astlib__Migrate_503_502/index.html create mode 100644 sexplib0/Sexplib0/Sexp_conv_labeled_tuple/Fields/index.html create mode 100644 sexplib0/Sexplib0/Sexp_conv_labeled_tuple/index.html create mode 100644 sexplib0/Sexplib0__Sexp_conv_labeled_tuple/index.html create mode 100644 trace-tef/Trace_tef__/index.html create mode 100644 trace-tef/Trace_tef__Event/index.html create mode 100644 trace-tef/Trace_tef_tldrs/index.html diff --git a/ppxlib/Astlib/Ast_502/Asttypes/index.html b/ppxlib/Astlib/Ast_502/Asttypes/index.html new file mode 100644 index 0000000..ad03219 --- /dev/null +++ b/ppxlib/Astlib/Ast_502/Asttypes/index.html @@ -0,0 +1,2 @@ + +Asttypes (ppxlib.Astlib.Ast_502.Asttypes)

Module Ast_502.Asttypes

type constant =
  1. | Const_int of int
  2. | Const_char of char
  3. | Const_string of string * Location.t * string option
  4. | Const_float of string
  5. | Const_int32 of int32
  6. | Const_int64 of int64
  7. | Const_nativeint of nativeint
type rec_flag =
  1. | Nonrecursive
  2. | Recursive
type direction_flag =
  1. | Upto
  2. | Downto
type private_flag =
  1. | Private
  2. | Public
type mutable_flag =
  1. | Immutable
  2. | Mutable
type virtual_flag =
  1. | Virtual
  2. | Concrete
type override_flag =
  1. | Override
  2. | Fresh
type closed_flag =
  1. | Closed
  2. | Open
type label = string
type arg_label =
  1. | Nolabel
  2. | Labelled of string
    (*

    label:T -> ...

    *)
  3. | Optional of string
    (*

    ?label:T -> ...

    *)
type 'a loc = 'a Location.loc = {
  1. txt : 'a;
  2. loc : Location.t;
}
type variance =
  1. | Covariant
  2. | Contravariant
  3. | NoVariance
type injectivity =
  1. | Injective
  2. | NoInjectivity
\ No newline at end of file diff --git a/ppxlib/Astlib/Ast_502/Config/index.html b/ppxlib/Astlib/Ast_502/Config/index.html new file mode 100644 index 0000000..876a31d --- /dev/null +++ b/ppxlib/Astlib/Ast_502/Config/index.html @@ -0,0 +1,2 @@ + +Config (ppxlib.Astlib.Ast_502.Config)

Module Ast_502.Config

val ast_impl_magic_number : string
val ast_intf_magic_number : string
\ No newline at end of file diff --git a/ppxlib/Astlib/Ast_502/Parsetree/index.html b/ppxlib/Astlib/Ast_502/Parsetree/index.html new file mode 100644 index 0000000..01f713e --- /dev/null +++ b/ppxlib/Astlib/Ast_502/Parsetree/index.html @@ -0,0 +1,25 @@ + +Parsetree (ppxlib.Astlib.Ast_502.Parsetree)

Module Ast_502.Parsetree

type constant =
  1. | Pconst_integer of string * char option
    (*

    Integer constants such as 3 3l 3L 3n.

    Suffixes [g-z][G-Z] are accepted by the parser. Suffixes except 'l', 'L' and 'n' are rejected by the typechecker

    *)
  2. | Pconst_char of char
    (*

    Character such as 'c'.

    *)
  3. | Pconst_string of string * Location.t * string option
    (*

    Constant string such as "constant" or {delim|other constant|delim}.

    The location span the content of the string, without the delimiters.

    *)
  4. | Pconst_float of string * char option
    (*

    Float constant such as 3.4, 2e5 or 1.4e-4.

    Suffixes g-zG-Z are accepted by the parser. Suffixes are rejected by the typechecker.

    *)
type location_stack = Location.t list

Extension points

type attribute = {
  1. attr_name : string Asttypes.loc;
  2. attr_payload : payload;
  3. attr_loc : Location.t;
}

Attributes such as [\@id ARG] and [\@\@id ARG].

Metadata containers passed around within the AST. The compiler ignores unknown attributes.

and extension = string Asttypes.loc * payload

Extension points such as [%id ARG] and [%%id ARG].

Sub-language placeholder -- rejected by the typechecker.

and attributes = attribute list
and payload =
  1. | PStr of structure
  2. | PSig of signature
    (*

    : SIG in an attribute or an extension point

    *)
  3. | PTyp of core_type
    (*

    : T in an attribute or an extension point

    *)
  4. | PPat of pattern * expression option
    (*

    ? P or ? P when E, in an attribute or an extension point

    *)

Core language

Type expressions

and core_type = {
  1. ptyp_desc : core_type_desc;
  2. ptyp_loc : Location.t;
  3. ptyp_loc_stack : location_stack;
  4. ptyp_attributes : attributes;
    (*

    ... [\@id1] [\@id2]

    *)
}
and core_type_desc =
  1. | Ptyp_any
    (*

    _

    *)
  2. | Ptyp_var of string
    (*

    A type variable such as 'a

    *)
  3. | Ptyp_arrow of Asttypes.arg_label * core_type * core_type
    (*

    Ptyp_arrow(lbl, T1, T2) represents:

    *)
  4. | Ptyp_tuple of core_type list
    (*

    Ptyp_tuple([T1 ; ... ; Tn]) represents a product type T1 * ... * Tn.

    Invariant: n >= 2.

    *)
  5. | Ptyp_constr of Longident.t Asttypes.loc * core_type list
    (*

    Ptyp_constr(lident, l) represents:

    • tconstr when l=[],
    • T tconstr when l=[T],
    • (T1, ..., Tn) tconstr when l=[T1 ; ... ; Tn].
    *)
  6. | Ptyp_object of object_field list * Asttypes.closed_flag
    (*

    Ptyp_object([ l1:T1; ...; ln:Tn ], flag) represents:

    • < l1:T1; ...; ln:Tn > when flag is Closed,
    • < l1:T1; ...; ln:Tn; .. > when flag is Open.
    *)
  7. | Ptyp_class of Longident.t Asttypes.loc * core_type list
    (*

    Ptyp_class(tconstr, l) represents:

    • #tconstr when l=[],
    • T #tconstr when l=[T],
    • (T1, ..., Tn) #tconstr when l=[T1 ; ... ; Tn].
    *)
  8. | Ptyp_alias of core_type * string Asttypes.loc
    (*

    T as 'a.

    *)
  9. | Ptyp_variant of row_field list + * Asttypes.closed_flag + * Asttypes.label list option
    (*

    Ptyp_variant([`A;`B], flag, labels) represents:

    • [ `A|`B ] when flag is Closed, and labels is None,
    • [> `A|`B ] when flag is Open, and labels is None,
    • [< `A|`B ] when flag is Closed, and labels is Some [],
    • [< `A|`B > `X `Y ] when flag is Closed, and labels is Some ["X";"Y"].
    *)
  10. | Ptyp_poly of string Asttypes.loc list * core_type
    (*

    'a1 ... 'an. T

    Can only appear in the following context:

    let x : 'a1 ... 'an. T = e ...
    *)
  11. | Ptyp_package of package_type
    (*

    (module S).

    *)
  12. | Ptyp_open of Longident.t Asttypes.loc * core_type
    (*

    M.(T)

    *)
  13. | Ptyp_extension of extension
    (*

    [%id].

    *)

As package_type typed values:

  • (S, []) represents (module S),
  • (S, [(t1, T1) ; ... ; (tn, Tn)]) represents (module S with type t1 = T1 and ... and tn = Tn).
and row_field = {
  1. prf_desc : row_field_desc;
  2. prf_loc : Location.t;
  3. prf_attributes : attributes;
}
and row_field_desc =
  1. | Rtag of Asttypes.label Asttypes.loc * bool * core_type list
    (*

    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)
    *)
  2. | Rinherit of core_type
    (*

    [ | t ]

    *)
and object_field = {
  1. pof_desc : object_field_desc;
  2. pof_loc : Location.t;
  3. pof_attributes : attributes;
}
and object_field_desc =
  1. | Otag of Asttypes.label Asttypes.loc * core_type
  2. | Oinherit of core_type

Patterns

and pattern = {
  1. ppat_desc : pattern_desc;
  2. ppat_loc : Location.t;
  3. ppat_loc_stack : location_stack;
  4. ppat_attributes : attributes;
    (*

    ... [\@id1] [\@id2]

    *)
}
and pattern_desc =
  1. | Ppat_any
    (*

    The pattern _.

    *)
  2. | Ppat_var of string Asttypes.loc
    (*

    A variable pattern such as x

    *)
  3. | Ppat_alias of pattern * string Asttypes.loc
    (*

    An alias pattern such as P as 'a

    *)
  4. | Ppat_constant of constant
    (*

    Patterns such as 1, 'a', "true", 1.0, 1l, 1L, 1n

    *)
  5. | Ppat_interval of constant * constant
    (*

    Patterns such as 'a'..'z'.

    Other forms of interval are recognized by the parser but rejected by the type-checker.

    *)
  6. | Ppat_tuple of pattern list
    (*

    Patterns (P1, ..., Pn).

    Invariant: n >= 2

    *)
  7. | Ppat_construct of Longident.t Asttypes.loc + * (string Asttypes.loc list * pattern) option
    (*

    Ppat_construct(C, args) represents:

    • C when args is None,
    • C P when args is Some ([], P)
    • C (P1, ..., Pn) when args is Some ([], Ppat_tuple [P1; ...; Pn])
    • C (type a b) P when args is Some ([a; b], P)
    *)
  8. | Ppat_variant of Asttypes.label * pattern option
    (*

    Ppat_variant(`A, pat) represents:

    • `A when pat is None,
    • `A P when pat is Some P
    *)
  9. | Ppat_record of (Longident.t Asttypes.loc * pattern) list * Asttypes.closed_flag
    (*

    Ppat_record([(l1, P1) ; ... ; (ln, Pn)], flag) represents:

    • { l1=P1; ...; ln=Pn } when flag is Closed
    • { l1=P1; ...; ln=Pn; _} when flag is Open

    Invariant: n > 0

    *)
  10. | Ppat_array of pattern list
    (*

    Pattern [| P1; ...; Pn |]

    *)
  11. | Ppat_or of pattern * pattern
    (*

    Pattern P1 | P2

    *)
  12. | Ppat_constraint of pattern * core_type
    (*

    Pattern (P : T)

    *)
  13. | Ppat_type of Longident.t Asttypes.loc
    (*

    Pattern #tconst

    *)
  14. | Ppat_lazy of pattern
    (*

    Pattern lazy P

    *)
  15. | Ppat_unpack of string option Asttypes.loc
    (*

    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)

    *)
  16. | Ppat_exception of pattern
    (*

    Pattern exception P

    *)
  17. | Ppat_extension of extension
    (*

    Pattern [%id]

    *)
  18. | Ppat_open of Longident.t Asttypes.loc * pattern
    (*

    Pattern M.(P)

    *)

Value expressions

and expression = {
  1. pexp_desc : expression_desc;
  2. pexp_loc : Location.t;
  3. pexp_loc_stack : location_stack;
  4. pexp_attributes : attributes;
    (*

    ... [\@id1] [\@id2]

    *)
}
and expression_desc =
  1. | Pexp_ident of Longident.t Asttypes.loc
    (*

    Identifiers such as x and M.x

    *)
  2. | Pexp_constant of constant
    (*

    Expressions constant such as 1, 'a', "true", 1.0, 1l, 1L, 1n

    *)
  3. | Pexp_let of Asttypes.rec_flag * value_binding list * expression
    (*

    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.
    *)
  4. | Pexp_function of function_param list * type_constraint option * function_body
    (*

    Pexp_function ([P1; ...; Pn], C, body) represents any construct involving fun or function, including:

    • fun P1 ... Pn -> E when body = Pfunction_body E
    • fun P1 ... Pn -> function p1 -> e1 | ... | pm -> em when body = Pfunction_cases [ p1 -> e1; ...; pm -> em ] C represents a type constraint or coercion placed immediately before the arrow, e.g. fun P1 ... Pn : ty -> ... when C = Some (Pconstraint ty). A function must have parameters. Pexp_function (params, _, body) must have non-empty params or a Pfunction_cases _ body.
    *)
  5. | Pexp_apply of expression * (Asttypes.arg_label * expression) list
    (*

    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

    *)
  6. | Pexp_match of expression * case list
    (*

    match E0 with P1 -> E1 | ... | Pn -> En

    *)
  7. | Pexp_try of expression * case list
    (*

    try E0 with P1 -> E1 | ... | Pn -> En

    *)
  8. | Pexp_tuple of expression list
    (*

    Expressions (E1, ..., En)

    Invariant: n >= 2

    *)
  9. | Pexp_construct of Longident.t Asttypes.loc * expression option
    (*

    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])
    *)
  10. | Pexp_variant of Asttypes.label * expression option
    (*

    Pexp_variant(`A, exp) represents

    • `A when exp is None
    • `A E when exp is Some E
    *)
  11. | Pexp_record of (Longident.t Asttypes.loc * expression) list * expression option
    (*

    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

    *)
  12. | Pexp_field of expression * Longident.t Asttypes.loc
    (*

    E.l

    *)
  13. | Pexp_setfield of expression * Longident.t Asttypes.loc * expression
    (*

    E1.l <- E2

    *)
  14. | Pexp_array of expression list
    (*

    [| E1; ...; En |]

    *)
  15. | Pexp_ifthenelse of expression * expression * expression option
    (*

    if E1 then E2 else E3

    *)
  16. | Pexp_sequence of expression * expression
    (*

    E1; E2

    *)
  17. | Pexp_while of expression * expression
    (*

    while E1 do E2 done

    *)
  18. | Pexp_for of pattern + * expression + * expression + * Asttypes.direction_flag + * expression
    (*

    Pexp_for(i, E1, E2, direction, E3) represents:

    • for i = E1 to E2 do E3 done when direction is Upto
    • for i = E1 downto E2 do E3 done when direction is Downto
    *)
  19. | Pexp_constraint of expression * core_type
    (*

    (E : T)

    *)
  20. | Pexp_coerce of expression * core_type option * core_type
    (*

    Pexp_coerce(E, from, T) represents

    • (E :> T) when from is None,
    • (E : T0 :> T) when from is Some T0.
    *)
  21. | Pexp_send of expression * Asttypes.label Asttypes.loc
    (*

    E # m

    *)
  22. | Pexp_new of Longident.t Asttypes.loc
    (*

    new M.c

    *)
  23. | Pexp_setinstvar of Asttypes.label Asttypes.loc * expression
    (*

    x <- 2

    *)
  24. | Pexp_override of (Asttypes.label Asttypes.loc * expression) list
    (*

    {< x1 = E1; ...; xn = En >}

    *)
  25. | Pexp_letmodule of string option Asttypes.loc * module_expr * expression
    (*

    let module M = ME in E

    *)
  26. | Pexp_letexception of extension_constructor * expression
    (*

    let exception C in E

    *)
  27. | Pexp_assert of expression
    (*

    assert E.

    Note: assert false is treated in a special way by the type-checker.

    *)
  28. | Pexp_lazy of expression
    (*

    lazy E

    *)
  29. | Pexp_poly of expression * core_type option
    (*

    Used for method bodies.

    Can only be used as the expression under Cfk_concrete for methods (not values).

    *)
  30. | Pexp_object of class_structure
    (*

    object ... end

    *)
  31. | Pexp_newtype of string Asttypes.loc * expression
    (*

    fun (type t) -> E

    *)
  32. | Pexp_pack of module_expr
    (*

    (module ME).

    (module ME : S) is represented as Pexp_constraint(Pexp_pack ME, Ptyp_package S)

    *)
  33. | Pexp_open of open_declaration * expression
    (*
    • M.(E)
    • let open M in E
    • let open! M in E
    *)
  34. | Pexp_letop of letop
    (*
    • let* P = E0 in E1
    • let* P0 = E00 and* P1 = E01 in E1
    *)
  35. | Pexp_extension of extension
    (*

    [%id]

    *)
  36. | Pexp_unreachable
    (*

    .

    *)
and case = {
  1. pc_lhs : pattern;
  2. pc_guard : expression option;
  3. pc_rhs : expression;
}

Values of type case represents (P -> E) or (P when E0 -> E)

and letop = {
  1. let_ : binding_op;
  2. ands : binding_op list;
  3. body : expression;
}
and binding_op = {
  1. pbop_op : string Asttypes.loc;
  2. pbop_pat : pattern;
  3. pbop_exp : expression;
  4. pbop_loc : Location.t;
}
and function_param_desc =
  1. | Pparam_val of Asttypes.arg_label * expression option * pattern
    (*

    Pparam_val (lbl, exp0, P) represents the parameter:

    Note: If E0 is provided, only Optional is allowed.

    *)
  2. | Pparam_newtype of string Asttypes.loc
    (*

    Pparam_newtype x represents the parameter (type x). x carries the location of the identifier, whereas the pparam_loc on the enclosing function_param node is the location of the (type x) as a whole.

    Multiple parameters (type a b c) are represented as multiple Pparam_newtype nodes, let's say:

    [ { pparam_kind = Pparam_newtype a; pparam_loc = loc1 };
    +  { pparam_kind = Pparam_newtype b; pparam_loc = loc2 };
    +  { pparam_kind = Pparam_newtype c; pparam_loc = loc3 };
    +]

    Here, the first loc loc1 is the location of (type a b c), and the subsequent locs loc2 and loc3 are the same as loc1, except marked as ghost locations. The locations on a, b, c, correspond to the variables a, b, and c in the source code.

    *)
and function_param = {
  1. pparam_loc : Location.t;
  2. pparam_desc : function_param_desc;
}
and function_body =
  1. | Pfunction_body of expression
  2. | Pfunction_cases of case list * Location.t * attributes
    (*

    In Pfunction_cases (_, loc, attrs), the location extends from the start of the function keyword to the end of the last case. The compiler will only use typechecking-related attributes from attrs, e.g. enabling or disabling a warning.

    *)

See the comment on Pexp_function.

and type_constraint =
  1. | Pconstraint of core_type
  2. | Pcoerce of core_type option * core_type
    (*

    See the comment on Pexp_function.

    *)

Value descriptions

and value_description = {
  1. pval_name : string Asttypes.loc;
  2. pval_type : core_type;
  3. pval_prim : string list;
  4. pval_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
  5. pval_loc : Location.t;
}

Values of type value_description represents:

  • val x: T, when pval_prim is []
  • external x: T = "s1" ... "sn" when pval_prim is ["s1";..."sn"]

Type declarations

and type_declaration = {
  1. ptype_name : string Asttypes.loc;
  2. ptype_params : (core_type * (Asttypes.variance * Asttypes.injectivity)) list;
    (*

    ('a1,...'an) t

    *)
  3. ptype_cstrs : (core_type * core_type * Location.t) list;
    (*

    ... constraint T1=T1' ... constraint Tn=Tn'

    *)
  4. ptype_kind : type_kind;
  5. ptype_private : Asttypes.private_flag;
    (*

    for = private ...

    *)
  6. ptype_manifest : core_type option;
    (*

    represents = T

    *)
  7. ptype_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
  8. ptype_loc : Location.t;
}

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.
and type_kind =
  1. | Ptype_abstract
  2. | Ptype_variant of constructor_declaration list
  3. | Ptype_record of label_declaration list
    (*

    Invariant: non-empty list

    *)
  4. | Ptype_open
and label_declaration = {
  1. pld_name : string Asttypes.loc;
  2. pld_mutable : Asttypes.mutable_flag;
  3. pld_type : core_type;
  4. pld_loc : Location.t;
  5. pld_attributes : attributes;
    (*

    l : T [\@id1] [\@id2]

    *)
}

Note: T can be a Ptyp_poly.

and constructor_declaration = {
  1. pcd_name : string Asttypes.loc;
  2. pcd_vars : string Asttypes.loc list;
  3. pcd_args : constructor_arguments;
  4. pcd_res : core_type option;
  5. pcd_loc : Location.t;
  6. pcd_attributes : attributes;
    (*

    C of ... [\@id1] [\@id2]

    *)
}
and constructor_arguments =
  1. | Pcstr_tuple of core_type list
  2. | Pcstr_record of label_declaration list
    (*

    Values of type constructor_declaration represents the constructor arguments of:

    • C of T1 * ... * Tn when res = None, and args = Pcstr_tuple [T1; ... ; Tn],
    • C: T0 when res = Some T0, and args = Pcstr_tuple [],
    • C: T1 * ... * Tn -> T0 when res = Some T0, and args = Pcstr_tuple [T1; ... ; Tn],
    • C of {...} when res = None, and args = Pcstr_record [...],
    • C: {...} -> T0 when res = Some T0, and args = Pcstr_record [...].
    *)
and type_extension = {
  1. ptyext_path : Longident.t Asttypes.loc;
  2. ptyext_params : (core_type * (Asttypes.variance * Asttypes.injectivity)) list;
  3. ptyext_constructors : extension_constructor list;
  4. ptyext_private : Asttypes.private_flag;
  5. ptyext_loc : Location.t;
  6. ptyext_attributes : attributes;
    (*

    ... \@\@id1 \@\@id2

    *)
}

Definition of new extensions constructors for the extensive sum type t (type t += ...).

and extension_constructor = {
  1. pext_name : string Asttypes.loc;
  2. pext_kind : extension_constructor_kind;
  3. pext_loc : Location.t;
  4. pext_attributes : attributes;
    (*

    C of ... [\@id1] [\@id2]

    *)
}
and type_exception = {
  1. ptyexn_constructor : extension_constructor;
  2. ptyexn_loc : Location.t;
  3. ptyexn_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
}

Definition of a new exception (exception E).

and extension_constructor_kind =
  1. | Pext_decl of string Asttypes.loc list + * constructor_arguments + * core_type option
    (*

    Pext_decl(existentials, c_args, t_opt) describes a new extension constructor. It can be:

    • C of T1 * ... * Tn when:

      • existentials is [],
      • c_args is [T1; ...; Tn],
      • t_opt is None.
    • C: T0 when

      • existentials is [],
      • c_args is [],
      • t_opt is Some T0.
    • C: T1 * ... * Tn -> T0 when

      • existentials is [],
      • c_args is [T1; ...; Tn],
      • t_opt is Some T0.
    • C: 'a... . T1 * ... * Tn -> T0 when

      • existentials is ['a;...],
      • c_args is [T1; ... ; Tn],
      • t_opt is Some T0.
    *)
  2. | Pext_rebind of Longident.t Asttypes.loc
    (*

    Pext_rebind(D) re-export the constructor D with the new name C

    *)

Class language

Type expressions for the class language

and class_type = {
  1. pcty_desc : class_type_desc;
  2. pcty_loc : Location.t;
  3. pcty_attributes : attributes;
    (*

    ... [\@id1] [\@id2]

    *)
}
and class_type_desc =
  1. | Pcty_constr of Longident.t Asttypes.loc * core_type list
    (*
    • c
    • ['a1, ..., 'an] c
    *)
  2. | Pcty_signature of class_signature
    (*

    object ... end

    *)
  3. | Pcty_arrow of Asttypes.arg_label * core_type * class_type
    (*

    Pcty_arrow(lbl, T, CT) represents:

    *)
  4. | Pcty_extension of extension
    (*

    %id

    *)
  5. | Pcty_open of open_description * class_type
    (*

    let open M in CT

    *)
and class_signature = {
  1. pcsig_self : core_type;
  2. pcsig_fields : class_type_field list;
}

Values of type class_signature represents:

and class_type_field = {
  1. pctf_desc : class_type_field_desc;
  2. pctf_loc : Location.t;
  3. pctf_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
}
and class_type_field_desc =
  1. | Pctf_inherit of class_type
    (*

    inherit CT

    *)
  2. | Pctf_val of Asttypes.label Asttypes.loc + * Asttypes.mutable_flag + * Asttypes.virtual_flag + * core_type
    (*

    val x: T

    *)
  3. | Pctf_method of Asttypes.label Asttypes.loc + * Asttypes.private_flag + * Asttypes.virtual_flag + * core_type
    (*

    method x: T

    Note: T can be a Ptyp_poly.

    *)
  4. | Pctf_constraint of core_type * core_type
    (*

    constraint T1 = T2

    *)
  5. | Pctf_attribute of attribute
    (*

    [\@\@\@id]

    *)
  6. | Pctf_extension of extension
    (*

    [%%id]

    *)
and 'a class_infos = {
  1. pci_virt : Asttypes.virtual_flag;
  2. pci_params : (core_type * (Asttypes.variance * Asttypes.injectivity)) list;
  3. pci_name : string Asttypes.loc;
  4. pci_expr : 'a;
  5. pci_loc : Location.t;
  6. pci_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
}

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.

and class_description = class_type class_infos
and class_type_declaration = class_type class_infos

Value expressions for the class language

and class_expr = {
  1. pcl_desc : class_expr_desc;
  2. pcl_loc : Location.t;
  3. pcl_attributes : attributes;
    (*

    ... [\@id1] [\@id2]

    *)
}
and class_expr_desc =
  1. | Pcl_constr of Longident.t Asttypes.loc * core_type list
    (*

    c and ['a1, ..., 'an] c

    *)
  2. | Pcl_structure of class_structure
    (*

    object ... end

    *)
  3. | Pcl_fun of Asttypes.arg_label * expression option * pattern * class_expr
    (*

    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.
    *)
  4. | Pcl_apply of class_expr * (Asttypes.arg_label * expression) list
    (*

    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

    *)
  5. | Pcl_let of Asttypes.rec_flag * value_binding list * class_expr
    (*

    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.
    *)
  6. | Pcl_constraint of class_expr * class_type
    (*

    (CE : CT)

    *)
  7. | Pcl_extension of extension
    (*

    [%id]

    *)
  8. | Pcl_open of open_description * class_expr
    (*

    let open M in CE

    *)
and class_structure = {
  1. pcstr_self : pattern;
  2. pcstr_fields : class_field list;
}

Values of type class_structure represents:

and class_field = {
  1. pcf_desc : class_field_desc;
  2. pcf_loc : Location.t;
  3. pcf_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
}
and class_field_desc =
  1. | Pcf_inherit of Asttypes.override_flag * class_expr * string Asttypes.loc option
    (*

    Pcf_inherit(flag, CE, s) represents:

    • inherit CE when flag is Fresh and s is None,
    • inherit CE as x when flag is Fresh and s is Some x,
    • inherit! CE when flag is Override and s is None,
    • inherit! CE as x when flag is Override and s is Some x
    *)
  2. | Pcf_val of Asttypes.label Asttypes.loc + * Asttypes.mutable_flag + * class_field_kind
    (*

    Pcf_val(x,flag, kind) represents:

    *)
  3. | Pcf_method of Asttypes.label Asttypes.loc + * Asttypes.private_flag + * class_field_kind
    (**)
  4. | Pcf_constraint of core_type * core_type
    (*

    constraint T1 = T2

    *)
  5. | Pcf_initializer of expression
    (*

    initializer E

    *)
  6. | Pcf_attribute of attribute
    (*

    [\@\@\@id]

    *)
  7. | Pcf_extension of extension
    (*

    [%%id]

    *)
and class_field_kind =
  1. | Cfk_virtual of core_type
  2. | Cfk_concrete of Asttypes.override_flag * expression
and class_declaration = class_expr class_infos

Module language

Type expressions for the module language

and module_type = {
  1. pmty_desc : module_type_desc;
  2. pmty_loc : Location.t;
  3. pmty_attributes : attributes;
    (*

    ... [\@id1] [\@id2]

    *)
}
and module_type_desc =
  1. | Pmty_ident of Longident.t Asttypes.loc
    (*

    Pmty_ident(S) represents S

    *)
  2. | Pmty_signature of signature
    (*

    sig ... end

    *)
  3. | Pmty_functor of functor_parameter * module_type
    (*

    functor(X : MT1) -> MT2

    *)
  4. | Pmty_with of module_type * with_constraint list
    (*

    MT with ...

    *)
  5. | Pmty_typeof of module_expr
    (*

    module type of ME

    *)
  6. | Pmty_extension of extension
    (*

    [%id]

    *)
  7. | Pmty_alias of Longident.t Asttypes.loc
    (*

    (module M)

    *)
and functor_parameter =
  1. | Unit
    (*

    ()

    *)
  2. | Named of string option Asttypes.loc * module_type
    (*

    Named(name, MT) represents:

    • (X : MT) when name is Some X,
    • (_ : MT) when name is None
    *)
and signature = signature_item list
and signature_item = {
  1. psig_desc : signature_item_desc;
  2. psig_loc : Location.t;
}
and signature_item_desc =
  1. | Psig_value of value_description
    (*
    • val x: T
    • external x: T = "s1" ... "sn"
    *)
  2. | Psig_type of Asttypes.rec_flag * type_declaration list
    (*

    type t1 = ... and ... and tn = ...

    *)
  3. | Psig_typesubst of type_declaration list
    (*

    type t1 := ... and ... and tn := ...

    *)
  4. | Psig_typext of type_extension
    (*

    type t1 += ...

    *)
  5. | Psig_exception of type_exception
    (*

    exception C of T

    *)
  6. | Psig_module of module_declaration
    (*

    module X = M and module X : MT

    *)
  7. | Psig_modsubst of module_substitution
    (*

    module X := M

    *)
  8. | Psig_recmodule of module_declaration list
    (*

    module rec X1 : MT1 and ... and Xn : MTn

    *)
  9. | Psig_modtype of module_type_declaration
    (*

    module type S = MT and module type S

    *)
  10. | Psig_modtypesubst of module_type_declaration
    (*

    module type S := ...

    *)
  11. | Psig_open of open_description
    (*

    open X

    *)
  12. | Psig_include of include_description
    (*

    include MT

    *)
  13. | Psig_class of class_description list
    (*

    class c1 : ... and ... and cn : ...

    *)
  14. | Psig_class_type of class_type_declaration list
    (*

    class type ct1 = ... and ... and ctn = ...

    *)
  15. | Psig_attribute of attribute
    (*

    [\@\@\@id]

    *)
  16. | Psig_extension of extension * attributes
    (*

    [%%id]

    *)
and module_declaration = {
  1. pmd_name : string option Asttypes.loc;
  2. pmd_type : module_type;
  3. pmd_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
  4. pmd_loc : Location.t;
}

Values of type module_declaration represents S : MT

and module_substitution = {
  1. pms_name : string Asttypes.loc;
  2. pms_manifest : Longident.t Asttypes.loc;
  3. pms_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
  4. pms_loc : Location.t;
}

Values of type module_substitution represents S := M

and module_type_declaration = {
  1. pmtd_name : string Asttypes.loc;
  2. pmtd_type : module_type option;
  3. pmtd_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
  4. pmtd_loc : Location.t;
}

Values of type module_type_declaration represents:

  • S = MT,
  • S for abstract module type declaration, when pmtd_type is None.
and 'a open_infos = {
  1. popen_expr : 'a;
  2. popen_override : Asttypes.override_flag;
  3. popen_loc : Location.t;
  4. popen_attributes : attributes;
}

Values of type 'a open_infos represents:

and open_description = Longident.t Asttypes.loc open_infos

Values of type open_description represents:

  • open M.N
  • open M(N).O
and open_declaration = module_expr open_infos

Values of type open_declaration represents:

  • open M.N
  • open M(N).O
  • open struct ... end
and 'a include_infos = {
  1. pincl_mod : 'a;
  2. pincl_loc : Location.t;
  3. pincl_attributes : attributes;
}
and include_description = module_type include_infos

Values of type include_description represents include MT

and include_declaration = module_expr include_infos

Values of type include_declaration represents include ME

and with_constraint =
  1. | Pwith_type of Longident.t Asttypes.loc * type_declaration
    (*

    with type X.t = ...

    Note: the last component of the longident must match the name of the type_declaration.

    *)
  2. | Pwith_module of Longident.t Asttypes.loc * Longident.t Asttypes.loc
    (*

    with module X.Y = Z

    *)
  3. | Pwith_modtype of Longident.t Asttypes.loc * module_type
    (*

    with module type X.Y = Z

    *)
  4. | Pwith_modtypesubst of Longident.t Asttypes.loc * module_type
    (*

    with module type X.Y := sig end

    *)
  5. | Pwith_typesubst of Longident.t Asttypes.loc * type_declaration
    (*

    with type X.t := ..., same format as [Pwith_type]

    *)
  6. | Pwith_modsubst of Longident.t Asttypes.loc * Longident.t Asttypes.loc
    (*

    with module X.Y := Z

    *)

Value expressions for the module language

and module_expr = {
  1. pmod_desc : module_expr_desc;
  2. pmod_loc : Location.t;
  3. pmod_attributes : attributes;
    (*

    ... [\@id1] [\@id2]

    *)
}
and module_expr_desc =
  1. | Pmod_ident of Longident.t Asttypes.loc
    (*

    X

    *)
  2. | Pmod_structure of structure
    (*

    struct ... end

    *)
  3. | Pmod_functor of functor_parameter * module_expr
    (*

    functor(X : MT1) -> ME

    *)
  4. | Pmod_apply of module_expr * module_expr
    (*

    ME1(ME2)

    *)
  5. | Pmod_apply_unit of module_expr
    (*

    ME1()

    *)
  6. | Pmod_constraint of module_expr * module_type
    (*

    (ME : MT)

    *)
  7. | Pmod_unpack of expression
    (*

    (val E)

    *)
  8. | Pmod_extension of extension
    (*

    [%id]

    *)
and structure = structure_item list
and structure_item = {
  1. pstr_desc : structure_item_desc;
  2. pstr_loc : Location.t;
}
and structure_item_desc =
  1. | Pstr_eval of expression * attributes
    (*

    E

    *)
  2. | Pstr_value of Asttypes.rec_flag * value_binding list
    (*

    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.
    *)
  3. | Pstr_primitive of value_description
    (*
    • val x: T
    • external x: T = "s1" ... "sn"
    *)
  4. | Pstr_type of Asttypes.rec_flag * type_declaration list
    (*

    type t1 = ... and ... and tn = ...

    *)
  5. | Pstr_typext of type_extension
    (*

    type t1 += ...

    *)
  6. | Pstr_exception of type_exception
    (*
    • exception C of T
    • exception C = M.X
    *)
  7. | Pstr_module of module_binding
    (*

    module X = ME

    *)
  8. | Pstr_recmodule of module_binding list
    (*

    module rec X1 = ME1 and ... and Xn = MEn

    *)
  9. | Pstr_modtype of module_type_declaration
    (*

    module type S = MT

    *)
  10. | Pstr_open of open_declaration
    (*

    open X

    *)
  11. | Pstr_class of class_declaration list
    (*

    class c1 = ... and ... and cn = ...

    *)
  12. | Pstr_class_type of class_type_declaration list
    (*

    class type ct1 = ... and ... and ctn = ...

    *)
  13. | Pstr_include of include_declaration
    (*

    include ME

    *)
  14. | Pstr_attribute of attribute
    (*

    [\@\@\@id]

    *)
  15. | Pstr_extension of extension * attributes
    (*

    [%%id]

    *)
and value_constraint =
  1. | Pvc_constraint of {
    1. locally_abstract_univars : string Asttypes.loc list;
    2. typ : core_type;
    }
  2. | Pvc_coercion of {
    1. ground : core_type option;
    2. coercion : core_type;
    }
and value_binding = {
  1. pvb_pat : pattern;
  2. pvb_expr : expression;
  3. pvb_constraint : value_constraint option;
  4. pvb_attributes : attributes;
  5. pvb_loc : Location.t;
}
and module_binding = {
  1. pmb_name : string option Asttypes.loc;
  2. pmb_expr : module_expr;
  3. pmb_attributes : attributes;
  4. pmb_loc : Location.t;
}

Values of type module_binding represents module X = ME

Toplevel

Toplevel phrases

type toplevel_phrase =
  1. | Ptop_def of structure
  2. | Ptop_dir of toplevel_directive
    (*

    #use, #load ...

    *)
and toplevel_directive = {
  1. pdir_name : string Asttypes.loc;
  2. pdir_arg : directive_argument option;
  3. pdir_loc : Location.t;
}
and directive_argument = {
  1. pdira_desc : directive_argument_desc;
  2. pdira_loc : Location.t;
}
and directive_argument_desc =
  1. | Pdir_string of string
  2. | Pdir_int of string * char option
  3. | Pdir_ident of Longident.t
  4. | Pdir_bool of bool
\ No newline at end of file diff --git a/ppxlib/Astlib/Ast_502/index.html b/ppxlib/Astlib/Ast_502/index.html new file mode 100644 index 0000000..f730f13 --- /dev/null +++ b/ppxlib/Astlib/Ast_502/index.html @@ -0,0 +1,2 @@ + +Ast_502 (ppxlib.Astlib.Ast_502)

Module Astlib.Ast_502

module Asttypes : sig ... end
module Parsetree : sig ... end
module Config : sig ... end
\ No newline at end of file diff --git a/ppxlib/Astlib/Ast_503/Asttypes/index.html b/ppxlib/Astlib/Ast_503/Asttypes/index.html new file mode 100644 index 0000000..736e79a --- /dev/null +++ b/ppxlib/Astlib/Ast_503/Asttypes/index.html @@ -0,0 +1,2 @@ + +Asttypes (ppxlib.Astlib.Ast_503.Asttypes)

Module Ast_503.Asttypes

type constant =
  1. | Const_int of int
  2. | Const_char of char
  3. | Const_string of string * Location.t * string option
  4. | Const_float of string
  5. | Const_int32 of int32
  6. | Const_int64 of int64
  7. | Const_nativeint of nativeint
type rec_flag =
  1. | Nonrecursive
  2. | Recursive
type direction_flag =
  1. | Upto
  2. | Downto
type private_flag =
  1. | Private
  2. | Public
type mutable_flag =
  1. | Immutable
  2. | Mutable
type virtual_flag =
  1. | Virtual
  2. | Concrete
type override_flag =
  1. | Override
  2. | Fresh
type closed_flag =
  1. | Closed
  2. | Open
type label = string
type arg_label =
  1. | Nolabel
  2. | Labelled of string
    (*

    label:T -> ...

    *)
  3. | Optional of string
    (*

    ?label:T -> ...

    *)
type 'a loc = 'a Location.loc = {
  1. txt : 'a;
  2. loc : Location.t;
}
type variance =
  1. | Covariant
  2. | Contravariant
  3. | NoVariance
type injectivity =
  1. | Injective
  2. | NoInjectivity
\ No newline at end of file diff --git a/ppxlib/Astlib/Ast_503/Config/index.html b/ppxlib/Astlib/Ast_503/Config/index.html new file mode 100644 index 0000000..4f808ba --- /dev/null +++ b/ppxlib/Astlib/Ast_503/Config/index.html @@ -0,0 +1,2 @@ + +Config (ppxlib.Astlib.Ast_503.Config)

Module Ast_503.Config

val ast_impl_magic_number : string
val ast_intf_magic_number : string
\ No newline at end of file diff --git a/ppxlib/Astlib/Ast_503/Parsetree/index.html b/ppxlib/Astlib/Ast_503/Parsetree/index.html new file mode 100644 index 0000000..690735c --- /dev/null +++ b/ppxlib/Astlib/Ast_503/Parsetree/index.html @@ -0,0 +1,25 @@ + +Parsetree (ppxlib.Astlib.Ast_503.Parsetree)

Module Ast_503.Parsetree

type constant = {
  1. pconst_desc : constant_desc;
  2. pconst_loc : Location.t;
}
and constant_desc =
  1. | Pconst_integer of string * char option
    (*

    Integer constants such as 3 3l 3L 3n.

    Suffixes [g-z][G-Z] are accepted by the parser. Suffixes except 'l', 'L' and 'n' are rejected by the typechecker

    *)
  2. | Pconst_char of char
    (*

    Character such as 'c'.

    *)
  3. | Pconst_string of string * Location.t * string option
    (*

    Constant string such as "constant" or {delim|other constant|delim}.

    The location span the content of the string, without the delimiters.

    *)
  4. | Pconst_float of string * char option
    (*

    Float constant such as 3.4, 2e5 or 1.4e-4.

    Suffixes g-zG-Z are accepted by the parser. Suffixes are rejected by the typechecker.

    *)
type location_stack = Location.t list

Extension points

type attribute = {
  1. attr_name : string Asttypes.loc;
  2. attr_payload : payload;
  3. attr_loc : Location.t;
}

Attributes such as [\@id ARG] and [\@\@id ARG].

Metadata containers passed around within the AST. The compiler ignores unknown attributes.

and extension = string Asttypes.loc * payload

Extension points such as [%id ARG] and [%%id ARG].

Sub-language placeholder -- rejected by the typechecker.

and attributes = attribute list
and payload =
  1. | PStr of structure
  2. | PSig of signature
    (*

    : SIG in an attribute or an extension point

    *)
  3. | PTyp of core_type
    (*

    : T in an attribute or an extension point

    *)
  4. | PPat of pattern * expression option
    (*

    ? P or ? P when E, in an attribute or an extension point

    *)

Core language

Type expressions

and core_type = {
  1. ptyp_desc : core_type_desc;
  2. ptyp_loc : Location.t;
  3. ptyp_loc_stack : location_stack;
  4. ptyp_attributes : attributes;
    (*

    ... [\@id1] [\@id2]

    *)
}
and core_type_desc =
  1. | Ptyp_any
    (*

    _

    *)
  2. | Ptyp_var of string
    (*

    A type variable such as 'a

    *)
  3. | Ptyp_arrow of Asttypes.arg_label * core_type * core_type
    (*

    Ptyp_arrow(lbl, T1, T2) represents:

    *)
  4. | Ptyp_tuple of core_type list
    (*

    Ptyp_tuple([T1 ; ... ; Tn]) represents a product type T1 * ... * Tn.

    Invariant: n >= 2.

    *)
  5. | Ptyp_constr of Longident.t Asttypes.loc * core_type list
    (*

    Ptyp_constr(lident, l) represents:

    • tconstr when l=[],
    • T tconstr when l=[T],
    • (T1, ..., Tn) tconstr when l=[T1 ; ... ; Tn].
    *)
  6. | Ptyp_object of object_field list * Asttypes.closed_flag
    (*

    Ptyp_object([ l1:T1; ...; ln:Tn ], flag) represents:

    • < l1:T1; ...; ln:Tn > when flag is Closed,
    • < l1:T1; ...; ln:Tn; .. > when flag is Open.
    *)
  7. | Ptyp_class of Longident.t Asttypes.loc * core_type list
    (*

    Ptyp_class(tconstr, l) represents:

    • #tconstr when l=[],
    • T #tconstr when l=[T],
    • (T1, ..., Tn) #tconstr when l=[T1 ; ... ; Tn].
    *)
  8. | Ptyp_alias of core_type * string Asttypes.loc
    (*

    T as 'a.

    *)
  9. | Ptyp_variant of row_field list + * Asttypes.closed_flag + * Asttypes.label list option
    (*

    Ptyp_variant([`A;`B], flag, labels) represents:

    • [ `A|`B ] when flag is Closed, and labels is None,
    • [> `A|`B ] when flag is Open, and labels is None,
    • [< `A|`B ] when flag is Closed, and labels is Some [],
    • [< `A|`B > `X `Y ] when flag is Closed, and labels is Some ["X";"Y"].
    *)
  10. | Ptyp_poly of string Asttypes.loc list * core_type
    (*

    '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 ...
    *)
  11. | Ptyp_package of package_type
    (*

    (module S).

    *)
  12. | Ptyp_open of Longident.t Asttypes.loc * core_type
    (*

    M.(T)

    *)
  13. | Ptyp_extension of extension
    (*

    [%id].

    *)

As package_type typed values:

  • (S, []) represents (module S),
  • (S, [(t1, T1) ; ... ; (tn, Tn)]) represents (module S with type t1 = T1 and ... and tn = Tn).
and row_field = {
  1. prf_desc : row_field_desc;
  2. prf_loc : Location.t;
  3. prf_attributes : attributes;
}
and row_field_desc =
  1. | Rtag of Asttypes.label Asttypes.loc * bool * core_type list
    (*

    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)
    *)
  2. | Rinherit of core_type
    (*

    [ | t ]

    *)
and object_field = {
  1. pof_desc : object_field_desc;
  2. pof_loc : Location.t;
  3. pof_attributes : attributes;
}
and object_field_desc =
  1. | Otag of Asttypes.label Asttypes.loc * core_type
  2. | Oinherit of core_type

Patterns

and pattern = {
  1. ppat_desc : pattern_desc;
  2. ppat_loc : Location.t;
  3. ppat_loc_stack : location_stack;
  4. ppat_attributes : attributes;
    (*

    ... [\@id1] [\@id2]

    *)
}
and pattern_desc =
  1. | Ppat_any
    (*

    The pattern _.

    *)
  2. | Ppat_var of string Asttypes.loc
    (*

    A variable pattern such as x

    *)
  3. | Ppat_alias of pattern * string Asttypes.loc
    (*

    An alias pattern such as P as 'a

    *)
  4. | Ppat_constant of constant
    (*

    Patterns such as 1, 'a', "true", 1.0, 1l, 1L, 1n

    *)
  5. | Ppat_interval of constant * constant
    (*

    Patterns such as 'a'..'z'.

    Other forms of interval are recognized by the parser but rejected by the type-checker.

    *)
  6. | Ppat_tuple of pattern list
    (*

    Patterns (P1, ..., Pn).

    Invariant: n >= 2

    *)
  7. | Ppat_construct of Longident.t Asttypes.loc + * (string Asttypes.loc list * pattern) option
    (*

    Ppat_construct(C, args) represents:

    • C when args is None,
    • C P when args is Some ([], P)
    • C (P1, ..., Pn) when args is Some ([], Ppat_tuple [P1; ...; Pn])
    • C (type a b) P when args is Some ([a; b], P)
    *)
  8. | Ppat_variant of Asttypes.label * pattern option
    (*

    Ppat_variant(`A, pat) represents:

    • `A when pat is None,
    • `A P when pat is Some P
    *)
  9. | Ppat_record of (Longident.t Asttypes.loc * pattern) list * Asttypes.closed_flag
    (*

    Ppat_record([(l1, P1) ; ... ; (ln, Pn)], flag) represents:

    • { l1=P1; ...; ln=Pn } when flag is Closed
    • { l1=P1; ...; ln=Pn; _} when flag is Open

    Invariant: n > 0

    *)
  10. | Ppat_array of pattern list
    (*

    Pattern [| P1; ...; Pn |]

    *)
  11. | Ppat_or of pattern * pattern
    (*

    Pattern P1 | P2

    *)
  12. | Ppat_constraint of pattern * core_type
    (*

    Pattern (P : T)

    *)
  13. | Ppat_type of Longident.t Asttypes.loc
    (*

    Pattern #tconst

    *)
  14. | Ppat_lazy of pattern
    (*

    Pattern lazy P

    *)
  15. | Ppat_unpack of string option Asttypes.loc
    (*

    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)

    *)
  16. | Ppat_exception of pattern
    (*

    Pattern exception P

    *)
  17. | Ppat_effect of pattern * pattern
  18. | Ppat_extension of extension
    (*

    Pattern [%id]

    *)
  19. | Ppat_open of Longident.t Asttypes.loc * pattern
    (*

    Pattern M.(P)

    *)

Value expressions

and expression = {
  1. pexp_desc : expression_desc;
  2. pexp_loc : Location.t;
  3. pexp_loc_stack : location_stack;
  4. pexp_attributes : attributes;
    (*

    ... [\@id1] [\@id2]

    *)
}
and expression_desc =
  1. | Pexp_ident of Longident.t Asttypes.loc
    (*

    Identifiers such as x and M.x

    *)
  2. | Pexp_constant of constant
    (*

    Expressions constant such as 1, 'a', "true", 1.0, 1l, 1L, 1n

    *)
  3. | Pexp_let of Asttypes.rec_flag * value_binding list * expression
    (*

    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.
    *)
  4. | Pexp_function of function_param list * type_constraint option * function_body
    (*

    Pexp_function ([P1; ...; Pn], C, body) represents any construct involving fun or function, including:

    • fun P1 ... Pn -> E when body = Pfunction_body E
    • fun P1 ... Pn -> function p1 -> e1 | ... | pm -> em when body = Pfunction_cases [ p1 -> e1; ...; pm -> em ]

    C represents a type constraint or coercion placed immediately before the arrow, e.g. fun P1 ... Pn : ty -> ... when C = Some (Pconstraint ty).

    A function must have parameters. Pexp_function (params, _, body) must have non-empty params or a Pfunction_cases _ body.

    *)
  5. | Pexp_apply of expression * (Asttypes.arg_label * expression) list
    (*

    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

    *)
  6. | Pexp_match of expression * case list
    (*

    match E0 with P1 -> E1 | ... | Pn -> En

    *)
  7. | Pexp_try of expression * case list
    (*

    try E0 with P1 -> E1 | ... | Pn -> En

    *)
  8. | Pexp_tuple of expression list
    (*

    Expressions (E1, ..., En)

    Invariant: n >= 2

    *)
  9. | Pexp_construct of Longident.t Asttypes.loc * expression option
    (*

    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])
    *)
  10. | Pexp_variant of Asttypes.label * expression option
    (*

    Pexp_variant(`A, exp) represents

    • `A when exp is None
    • `A E when exp is Some E
    *)
  11. | Pexp_record of (Longident.t Asttypes.loc * expression) list * expression option
    (*

    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

    *)
  12. | Pexp_field of expression * Longident.t Asttypes.loc
    (*

    E.l

    *)
  13. | Pexp_setfield of expression * Longident.t Asttypes.loc * expression
    (*

    E1.l <- E2

    *)
  14. | Pexp_array of expression list
    (*

    [| E1; ...; En |]

    *)
  15. | Pexp_ifthenelse of expression * expression * expression option
    (*

    if E1 then E2 else E3

    *)
  16. | Pexp_sequence of expression * expression
    (*

    E1; E2

    *)
  17. | Pexp_while of expression * expression
    (*

    while E1 do E2 done

    *)
  18. | Pexp_for of pattern + * expression + * expression + * Asttypes.direction_flag + * expression
    (*

    Pexp_for(i, E1, E2, direction, E3) represents:

    • for i = E1 to E2 do E3 done when direction is Upto
    • for i = E1 downto E2 do E3 done when direction is Downto
    *)
  19. | Pexp_constraint of expression * core_type
    (*

    (E : T)

    *)
  20. | Pexp_coerce of expression * core_type option * core_type
    (*

    Pexp_coerce(E, from, T) represents

    • (E :> T) when from is None,
    • (E : T0 :> T) when from is Some T0.
    *)
  21. | Pexp_send of expression * Asttypes.label Asttypes.loc
    (*

    E # m

    *)
  22. | Pexp_new of Longident.t Asttypes.loc
    (*

    new M.c

    *)
  23. | Pexp_setinstvar of Asttypes.label Asttypes.loc * expression
    (*

    x <- 2

    *)
  24. | Pexp_override of (Asttypes.label Asttypes.loc * expression) list
    (*

    {< x1 = E1; ...; xn = En >}

    *)
  25. | Pexp_letmodule of string option Asttypes.loc * module_expr * expression
    (*

    let module M = ME in E

    *)
  26. | Pexp_letexception of extension_constructor * expression
    (*

    let exception C in E

    *)
  27. | Pexp_assert of expression
    (*

    assert E.

    Note: assert false is treated in a special way by the type-checker.

    *)
  28. | Pexp_lazy of expression
    (*

    lazy E

    *)
  29. | Pexp_poly of expression * core_type option
    (*

    Used for method bodies.

    Can only be used as the expression under Cfk_concrete for methods (not values).

    *)
  30. | Pexp_object of class_structure
    (*

    object ... end

    *)
  31. | Pexp_newtype of string Asttypes.loc * expression
    (*

    fun (type t) -> E

    *)
  32. | Pexp_pack of module_expr
    (*

    (module ME).

    (module ME : S) is represented as Pexp_constraint(Pexp_pack ME, Ptyp_package S)

    *)
  33. | Pexp_open of open_declaration * expression
    (*
    • M.(E)
    • let open M in E
    • let open! M in E
    *)
  34. | Pexp_letop of letop
    (*
    • let* P = E0 in E1
    • let* P0 = E00 and* P1 = E01 in E1
    *)
  35. | Pexp_extension of extension
    (*

    [%id]

    *)
  36. | Pexp_unreachable
    (*

    .

    *)
and case = {
  1. pc_lhs : pattern;
  2. pc_guard : expression option;
  3. pc_rhs : expression;
}

Values of type case represents (P -> E) or (P when E0 -> E)

and letop = {
  1. let_ : binding_op;
  2. ands : binding_op list;
  3. body : expression;
}
and binding_op = {
  1. pbop_op : string Asttypes.loc;
  2. pbop_pat : pattern;
  3. pbop_exp : expression;
  4. pbop_loc : Location.t;
}
and function_param_desc =
  1. | Pparam_val of Asttypes.arg_label * expression option * pattern
    (*

    Pparam_val (lbl, exp0, P) represents the parameter:

    Note: If E0 is provided, only Optional is allowed.

    *)
  2. | Pparam_newtype of string Asttypes.loc
    (*

    Pparam_newtype x represents the parameter (type x). x carries the location of the identifier, whereas the pparam_loc on the enclosing function_param node is the location of the (type x) as a whole.

    Multiple parameters (type a b c) are represented as multiple Pparam_newtype nodes, let's say:

    [ { pparam_kind = Pparam_newtype a; pparam_loc = loc1 };
    +  { pparam_kind = Pparam_newtype b; pparam_loc = loc2 };
    +  { pparam_kind = Pparam_newtype c; pparam_loc = loc3 };
    +]

    Here, the first loc loc1 is the location of (type a b c), and the subsequent locs loc2 and loc3 are the same as loc1, except marked as ghost locations. The locations on a, b, c, correspond to the variables a, b, and c in the source code.

    *)
and function_param = {
  1. pparam_loc : Location.t;
  2. pparam_desc : function_param_desc;
}
and function_body =
  1. | Pfunction_body of expression
  2. | Pfunction_cases of case list * Location.t * attributes
    (*

    In Pfunction_cases (_, loc, attrs), the location extends from the start of the function keyword to the end of the last case. The compiler will only use typechecking-related attributes from attrs, e.g. enabling or disabling a warning.

    *)

See the comment on Pexp_function.

and type_constraint =
  1. | Pconstraint of core_type
  2. | Pcoerce of core_type option * core_type
    (*

    See the comment on Pexp_function.

    *)

Value descriptions

and value_description = {
  1. pval_name : string Asttypes.loc;
  2. pval_type : core_type;
  3. pval_prim : string list;
  4. pval_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
  5. pval_loc : Location.t;
}

Values of type value_description represents:

  • val x: T, when pval_prim is []
  • external x: T = "s1" ... "sn" when pval_prim is ["s1";..."sn"]

Type declarations

and type_declaration = {
  1. ptype_name : string Asttypes.loc;
  2. ptype_params : (core_type * (Asttypes.variance * Asttypes.injectivity)) list;
    (*

    ('a1,...'an) t

    *)
  3. ptype_cstrs : (core_type * core_type * Location.t) list;
    (*

    ... constraint T1=T1' ... constraint Tn=Tn'

    *)
  4. ptype_kind : type_kind;
  5. ptype_private : Asttypes.private_flag;
    (*

    for = private ...

    *)
  6. ptype_manifest : core_type option;
    (*

    represents = T

    *)
  7. ptype_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
  8. ptype_loc : Location.t;
}

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.
and type_kind =
  1. | Ptype_abstract
  2. | Ptype_variant of constructor_declaration list
  3. | Ptype_record of label_declaration list
    (*

    Invariant: non-empty list

    *)
  4. | Ptype_open
and label_declaration = {
  1. pld_name : string Asttypes.loc;
  2. pld_mutable : Asttypes.mutable_flag;
  3. pld_type : core_type;
  4. pld_loc : Location.t;
  5. pld_attributes : attributes;
    (*

    l : T [\@id1] [\@id2]

    *)
}

Note: T can be a Ptyp_poly.

and constructor_declaration = {
  1. pcd_name : string Asttypes.loc;
  2. pcd_vars : string Asttypes.loc list;
  3. pcd_args : constructor_arguments;
  4. pcd_res : core_type option;
  5. pcd_loc : Location.t;
  6. pcd_attributes : attributes;
    (*

    C of ... [\@id1] [\@id2]

    *)
}
and constructor_arguments =
  1. | Pcstr_tuple of core_type list
  2. | Pcstr_record of label_declaration list
    (*

    Values of type constructor_declaration represents the constructor arguments of:

    • C of T1 * ... * Tn when res = None, and args = Pcstr_tuple [T1; ... ; Tn],
    • C: T0 when res = Some T0, and args = Pcstr_tuple [],
    • C: T1 * ... * Tn -> T0 when res = Some T0, and args = Pcstr_tuple [T1; ... ; Tn],
    • C of {...} when res = None, and args = Pcstr_record [...],
    • C: {...} -> T0 when res = Some T0, and args = Pcstr_record [...].
    *)
and type_extension = {
  1. ptyext_path : Longident.t Asttypes.loc;
  2. ptyext_params : (core_type * (Asttypes.variance * Asttypes.injectivity)) list;
  3. ptyext_constructors : extension_constructor list;
  4. ptyext_private : Asttypes.private_flag;
  5. ptyext_loc : Location.t;
  6. ptyext_attributes : attributes;
    (*

    ... \@\@id1 \@\@id2

    *)
}

Definition of new extensions constructors for the extensive sum type t (type t += ...).

and extension_constructor = {
  1. pext_name : string Asttypes.loc;
  2. pext_kind : extension_constructor_kind;
  3. pext_loc : Location.t;
  4. pext_attributes : attributes;
    (*

    C of ... [\@id1] [\@id2]

    *)
}
and type_exception = {
  1. ptyexn_constructor : extension_constructor;
  2. ptyexn_loc : Location.t;
  3. ptyexn_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
}

Definition of a new exception (exception E).

and extension_constructor_kind =
  1. | Pext_decl of string Asttypes.loc list + * constructor_arguments + * core_type option
    (*

    Pext_decl(existentials, c_args, t_opt) describes a new extension constructor. It can be:

    • C of T1 * ... * Tn when:

      • existentials is [],
      • c_args is [T1; ...; Tn],
      • t_opt is None
    • C: T0 when

      • existentials is [],
      • c_args is [],
      • t_opt is Some T0.
    • C: T1 * ... * Tn -> T0 when

      • existentials is [],
      • c_args is [T1; ...; Tn],
      • t_opt is Some T0.
    • C: 'a... . T1 * ... * Tn -> T0 when

      • existentials is ['a;...],
      • c_args is [T1; ... ; Tn],
      • t_opt is Some T0.
    *)
  2. | Pext_rebind of Longident.t Asttypes.loc
    (*

    Pext_rebind(D) re-export the constructor D with the new name C

    *)

Class language

Type expressions for the class language

and class_type = {
  1. pcty_desc : class_type_desc;
  2. pcty_loc : Location.t;
  3. pcty_attributes : attributes;
    (*

    ... [\@id1] [\@id2]

    *)
}
and class_type_desc =
  1. | Pcty_constr of Longident.t Asttypes.loc * core_type list
    (*
    • c
    • ['a1, ..., 'an] c
    *)
  2. | Pcty_signature of class_signature
    (*

    object ... end

    *)
  3. | Pcty_arrow of Asttypes.arg_label * core_type * class_type
    (*

    Pcty_arrow(lbl, T, CT) represents:

    *)
  4. | Pcty_extension of extension
    (*

    %id

    *)
  5. | Pcty_open of open_description * class_type
    (*

    let open M in CT

    *)
and class_signature = {
  1. pcsig_self : core_type;
  2. pcsig_fields : class_type_field list;
}

Values of type class_signature represents:

and class_type_field = {
  1. pctf_desc : class_type_field_desc;
  2. pctf_loc : Location.t;
  3. pctf_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
}
and class_type_field_desc =
  1. | Pctf_inherit of class_type
    (*

    inherit CT

    *)
  2. | Pctf_val of Asttypes.label Asttypes.loc + * Asttypes.mutable_flag + * Asttypes.virtual_flag + * core_type
    (*

    val x: T

    *)
  3. | Pctf_method of Asttypes.label Asttypes.loc + * Asttypes.private_flag + * Asttypes.virtual_flag + * core_type
    (*

    method x: T

    Note: T can be a Ptyp_poly.

    *)
  4. | Pctf_constraint of core_type * core_type
    (*

    constraint T1 = T2

    *)
  5. | Pctf_attribute of attribute
    (*

    [\@\@\@id]

    *)
  6. | Pctf_extension of extension
    (*

    [%%id]

    *)
and 'a class_infos = {
  1. pci_virt : Asttypes.virtual_flag;
  2. pci_params : (core_type * (Asttypes.variance * Asttypes.injectivity)) list;
  3. pci_name : string Asttypes.loc;
  4. pci_expr : 'a;
  5. pci_loc : Location.t;
  6. pci_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
}

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.

and class_description = class_type class_infos
and class_type_declaration = class_type class_infos

Value expressions for the class language

and class_expr = {
  1. pcl_desc : class_expr_desc;
  2. pcl_loc : Location.t;
  3. pcl_attributes : attributes;
    (*

    ... [\@id1] [\@id2]

    *)
}
and class_expr_desc =
  1. | Pcl_constr of Longident.t Asttypes.loc * core_type list
    (*

    c and ['a1, ..., 'an] c

    *)
  2. | Pcl_structure of class_structure
    (*

    object ... end

    *)
  3. | Pcl_fun of Asttypes.arg_label * expression option * pattern * class_expr
    (*

    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.
    *)
  4. | Pcl_apply of class_expr * (Asttypes.arg_label * expression) list
    (*

    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

    *)
  5. | Pcl_let of Asttypes.rec_flag * value_binding list * class_expr
    (*

    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.
    *)
  6. | Pcl_constraint of class_expr * class_type
    (*

    (CE : CT)

    *)
  7. | Pcl_extension of extension
    (*

    [%id]

    *)
  8. | Pcl_open of open_description * class_expr
    (*

    let open M in CE

    *)
and class_structure = {
  1. pcstr_self : pattern;
  2. pcstr_fields : class_field list;
}

Values of type class_structure represents:

and class_field = {
  1. pcf_desc : class_field_desc;
  2. pcf_loc : Location.t;
  3. pcf_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
}
and class_field_desc =
  1. | Pcf_inherit of Asttypes.override_flag * class_expr * string Asttypes.loc option
    (*

    Pcf_inherit(flag, CE, s) represents:

    • inherit CE when flag is Fresh and s is None,
    • inherit CE as x when flag is Fresh and s is Some x,
    • inherit! CE when flag is Override and s is None,
    • inherit! CE as x when flag is Override and s is Some x
    *)
  2. | Pcf_val of Asttypes.label Asttypes.loc + * Asttypes.mutable_flag + * class_field_kind
    (*

    Pcf_val(x,flag, kind) represents:

    *)
  3. | Pcf_method of Asttypes.label Asttypes.loc + * Asttypes.private_flag + * class_field_kind
    (**)
  4. | Pcf_constraint of core_type * core_type
    (*

    constraint T1 = T2

    *)
  5. | Pcf_initializer of expression
    (*

    initializer E

    *)
  6. | Pcf_attribute of attribute
    (*

    [\@\@\@id]

    *)
  7. | Pcf_extension of extension
    (*

    [%%id]

    *)
and class_field_kind =
  1. | Cfk_virtual of core_type
  2. | Cfk_concrete of Asttypes.override_flag * expression
and class_declaration = class_expr class_infos

Module language

Type expressions for the module language

and module_type = {
  1. pmty_desc : module_type_desc;
  2. pmty_loc : Location.t;
  3. pmty_attributes : attributes;
    (*

    ... [\@id1] [\@id2]

    *)
}
and module_type_desc =
  1. | Pmty_ident of Longident.t Asttypes.loc
    (*

    Pmty_ident(S) represents S

    *)
  2. | Pmty_signature of signature
    (*

    sig ... end

    *)
  3. | Pmty_functor of functor_parameter * module_type
    (*

    functor(X : MT1) -> MT2

    *)
  4. | Pmty_with of module_type * with_constraint list
    (*

    MT with ...

    *)
  5. | Pmty_typeof of module_expr
    (*

    module type of ME

    *)
  6. | Pmty_extension of extension
    (*

    [%id]

    *)
  7. | Pmty_alias of Longident.t Asttypes.loc
    (*

    (module M)

    *)
and functor_parameter =
  1. | Unit
    (*

    ()

    *)
  2. | Named of string option Asttypes.loc * module_type
    (*

    Named(name, MT) represents:

    • (X : MT) when name is Some X,
    • (_ : MT) when name is None
    *)
and signature = signature_item list
and signature_item = {
  1. psig_desc : signature_item_desc;
  2. psig_loc : Location.t;
}
and signature_item_desc =
  1. | Psig_value of value_description
    (*
    • val x: T
    • external x: T = "s1" ... "sn"
    *)
  2. | Psig_type of Asttypes.rec_flag * type_declaration list
    (*

    type t1 = ... and ... and tn = ...

    *)
  3. | Psig_typesubst of type_declaration list
    (*

    type t1 := ... and ... and tn := ...

    *)
  4. | Psig_typext of type_extension
    (*

    type t1 += ...

    *)
  5. | Psig_exception of type_exception
    (*

    exception C of T

    *)
  6. | Psig_module of module_declaration
    (*

    module X = M and module X : MT

    *)
  7. | Psig_modsubst of module_substitution
    (*

    module X := M

    *)
  8. | Psig_recmodule of module_declaration list
    (*

    module rec X1 : MT1 and ... and Xn : MTn

    *)
  9. | Psig_modtype of module_type_declaration
    (*

    module type S = MT and module type S

    *)
  10. | Psig_modtypesubst of module_type_declaration
    (*

    module type S := ...

    *)
  11. | Psig_open of open_description
    (*

    open X

    *)
  12. | Psig_include of include_description
    (*

    include MT

    *)
  13. | Psig_class of class_description list
    (*

    class c1 : ... and ... and cn : ...

    *)
  14. | Psig_class_type of class_type_declaration list
    (*

    class type ct1 = ... and ... and ctn = ...

    *)
  15. | Psig_attribute of attribute
    (*

    [\@\@\@id]

    *)
  16. | Psig_extension of extension * attributes
    (*

    [%%id]

    *)
and module_declaration = {
  1. pmd_name : string option Asttypes.loc;
  2. pmd_type : module_type;
  3. pmd_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
  4. pmd_loc : Location.t;
}

Values of type module_declaration represents S : MT

and module_substitution = {
  1. pms_name : string Asttypes.loc;
  2. pms_manifest : Longident.t Asttypes.loc;
  3. pms_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
  4. pms_loc : Location.t;
}

Values of type module_substitution represents S := M

and module_type_declaration = {
  1. pmtd_name : string Asttypes.loc;
  2. pmtd_type : module_type option;
  3. pmtd_attributes : attributes;
    (*

    ... [\@\@id1] [\@\@id2]

    *)
  4. pmtd_loc : Location.t;
}

Values of type module_type_declaration represents:

  • S = MT,
  • S for abstract module type declaration, when pmtd_type is None.
and 'a open_infos = {
  1. popen_expr : 'a;
  2. popen_override : Asttypes.override_flag;
  3. popen_loc : Location.t;
  4. popen_attributes : attributes;
}

Values of type 'a open_infos represents:

and open_description = Longident.t Asttypes.loc open_infos

Values of type open_description represents:

  • open M.N
  • open M(N).O
and open_declaration = module_expr open_infos

Values of type open_declaration represents:

  • open M.N
  • open M(N).O
  • open struct ... end
and 'a include_infos = {
  1. pincl_mod : 'a;
  2. pincl_loc : Location.t;
  3. pincl_attributes : attributes;
}
and include_description = module_type include_infos

Values of type include_description represents include MT

and include_declaration = module_expr include_infos

Values of type include_declaration represents include ME

and with_constraint =
  1. | Pwith_type of Longident.t Asttypes.loc * type_declaration
    (*

    with type X.t = ...

    Note: the last component of the longident must match the name of the type_declaration.

    *)
  2. | Pwith_module of Longident.t Asttypes.loc * Longident.t Asttypes.loc
    (*

    with module X.Y = Z

    *)
  3. | Pwith_modtype of Longident.t Asttypes.loc * module_type
    (*

    with module type X.Y = Z

    *)
  4. | Pwith_modtypesubst of Longident.t Asttypes.loc * module_type
    (*

    with module type X.Y := sig end

    *)
  5. | Pwith_typesubst of Longident.t Asttypes.loc * type_declaration
    (*

    with type X.t := ..., same format as [Pwith_type]

    *)
  6. | Pwith_modsubst of Longident.t Asttypes.loc * Longident.t Asttypes.loc
    (*

    with module X.Y := Z

    *)

Value expressions for the module language

and module_expr = {
  1. pmod_desc : module_expr_desc;
  2. pmod_loc : Location.t;
  3. pmod_attributes : attributes;
    (*

    ... [\@id1] [\@id2]

    *)
}
and module_expr_desc =
  1. | Pmod_ident of Longident.t Asttypes.loc
    (*

    X

    *)
  2. | Pmod_structure of structure
    (*

    struct ... end

    *)
  3. | Pmod_functor of functor_parameter * module_expr
    (*

    functor(X : MT1) -> ME

    *)
  4. | Pmod_apply of module_expr * module_expr
    (*

    ME1(ME2)

    *)
  5. | Pmod_apply_unit of module_expr
    (*

    ME1()

    *)
  6. | Pmod_constraint of module_expr * module_type
    (*

    (ME : MT)

    *)
  7. | Pmod_unpack of expression
    (*

    (val E)

    *)
  8. | Pmod_extension of extension
    (*

    [%id]

    *)
and structure = structure_item list
and structure_item = {
  1. pstr_desc : structure_item_desc;
  2. pstr_loc : Location.t;
}
and structure_item_desc =
  1. | Pstr_eval of expression * attributes
    (*

    E

    *)
  2. | Pstr_value of Asttypes.rec_flag * value_binding list
    (*

    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.
    *)
  3. | Pstr_primitive of value_description
    (*
    • val x: T
    • external x: T = "s1" ... "sn"
    *)
  4. | Pstr_type of Asttypes.rec_flag * type_declaration list
    (*

    type t1 = ... and ... and tn = ...

    *)
  5. | Pstr_typext of type_extension
    (*

    type t1 += ...

    *)
  6. | Pstr_exception of type_exception
    (*
    • exception C of T
    • exception C = M.X
    *)
  7. | Pstr_module of module_binding
    (*

    module X = ME

    *)
  8. | Pstr_recmodule of module_binding list
    (*

    module rec X1 = ME1 and ... and Xn = MEn

    *)
  9. | Pstr_modtype of module_type_declaration
    (*

    module type S = MT

    *)
  10. | Pstr_open of open_declaration
    (*

    open X

    *)
  11. | Pstr_class of class_declaration list
    (*

    class c1 = ... and ... and cn = ...

    *)
  12. | Pstr_class_type of class_type_declaration list
    (*

    class type ct1 = ... and ... and ctn = ...

    *)
  13. | Pstr_include of include_declaration
    (*

    include ME

    *)
  14. | Pstr_attribute of attribute
    (*

    [\@\@\@id]

    *)
  15. | Pstr_extension of extension * attributes
    (*

    [%%id]

    *)
and value_constraint =
  1. | Pvc_constraint of {
    1. locally_abstract_univars : string Asttypes.loc list;
    2. typ : core_type;
    }
  2. | Pvc_coercion of {
    1. ground : core_type option;
    2. coercion : core_type;
    }
    (*
    • Pvc_constraint { locally_abstract_univars=[]; typ} is a simple type constraint on a value binding: let x : typ
    • More generally, in Pvc_constraint { locally_abstract_univars; typ} locally_abstract_univars is the list of locally abstract type variables in let x: type a ... . typ
    • Pvc_coercion { ground=None; coercion } represents let x :> typ
    • Pvc_coercion { ground=Some g; coercion } represents let x : g :> typ
    *)
and value_binding = {
  1. pvb_pat : pattern;
  2. pvb_expr : expression;
  3. pvb_constraint : value_constraint option;
  4. pvb_attributes : attributes;
  5. pvb_loc : Location.t;
}

let pat : type_constraint = exp

and module_binding = {
  1. pmb_name : string option Asttypes.loc;
  2. pmb_expr : module_expr;
  3. pmb_attributes : attributes;
  4. pmb_loc : Location.t;
}

Values of type module_binding represents module X = ME

Toplevel

Toplevel phrases

type toplevel_phrase =
  1. | Ptop_def of structure
  2. | Ptop_dir of toplevel_directive
    (*

    #use, #load ...

    *)
and toplevel_directive = {
  1. pdir_name : string Asttypes.loc;
  2. pdir_arg : directive_argument option;
  3. pdir_loc : Location.t;
}
and directive_argument = {
  1. pdira_desc : directive_argument_desc;
  2. pdira_loc : Location.t;
}
and directive_argument_desc =
  1. | Pdir_string of string
  2. | Pdir_int of string * char option
  3. | Pdir_ident of Longident.t
  4. | Pdir_bool of bool
\ No newline at end of file diff --git a/ppxlib/Astlib/Ast_503/index.html b/ppxlib/Astlib/Ast_503/index.html new file mode 100644 index 0000000..a839b21 --- /dev/null +++ b/ppxlib/Astlib/Ast_503/index.html @@ -0,0 +1,2 @@ + +Ast_503 (ppxlib.Astlib.Ast_503)

Module Astlib.Ast_503

module Asttypes : sig ... end
module Parsetree : sig ... end
module Config : sig ... end
\ No newline at end of file diff --git a/ppxlib/Astlib/Location/index.html b/ppxlib/Astlib/Location/index.html index 4b44b49..14b12db 100644 --- a/ppxlib/Astlib/Location/index.html +++ b/ppxlib/Astlib/Location/index.html @@ -1,5 +1,5 @@ -Location (ppxlib.Astlib.Location)

Module Astlib.Location

Source code locations (ranges of positions), used in parsetrees

type t = Ocaml_common.Location.t = {
  1. loc_start : Stdlib.Lexing.position;
  2. loc_end : Stdlib.Lexing.position;
  3. loc_ghost : bool;
}

The location type

type 'a loc = 'a Ocaml_common.Location.loc = {
  1. txt : 'a;
  2. loc : t;
}

A located type

module Error : sig ... end
val set_input_name : string -> unit

Set the name of the input source, e.g. the file name.

val none : t

An arbitrary value of type t; describes an empty ghost range.

Automatically reporting errors for raised exceptions

val register_error_of_exn : (exn -> Error.t option) -> unit

Each compiler module which defines a custom type of exception which can surface as a user-visible error should register a "printer" for this exception using register_error_of_exn. The result of the printer is an error value containing a location, a message, and optionally sub-messages (each of them being located as well).

exception Error of Error.t

Located exception.

val raise_errorf : +Location (ppxlib.Astlib.Location)

Module Astlib.Location

Source code locations (ranges of positions), used in parsetrees

type t = Ocaml_common.Location.t = {
  1. loc_start : Stdlib.Lexing.position;
  2. loc_end : Stdlib.Lexing.position;
  3. loc_ghost : bool;
}

The location type

type 'a loc = 'a Ocaml_common.Location.loc = {
  1. txt : 'a;
  2. loc : t;
}

A located type

module Error : sig ... end
val set_input_name : string -> unit

Set the name of the input source, e.g. the file name.

val set_input_lexbuf : Stdlib.Lexing.lexbuf option -> unit

Set the name of the input source, e.g. the file name.

val none : t

An arbitrary value of type t; describes an empty ghost range.

Automatically reporting errors for raised exceptions

val register_error_of_exn : (exn -> Error.t option) -> unit

Each compiler module which defines a custom type of exception which can surface as a user-visible error should register a "printer" for this exception using register_error_of_exn. The result of the printer is an error value containing a location, a message, and optionally sub-messages (each of them being located as well).

exception Error of Error.t

Located exception.

val raise_errorf : ?loc:t -> ('a, Stdlib.Format.formatter, unit, 'b) format4 -> 'a

Raise a located exception.

val report_exception : Stdlib.Format.formatter -> exn -> unit

Report an exception on the given formatter

\ No newline at end of file diff --git a/ppxlib/Astlib/Migrate_501_502/index.html b/ppxlib/Astlib/Migrate_501_502/index.html new file mode 100644 index 0000000..3d05bda --- /dev/null +++ b/ppxlib/Astlib/Migrate_501_502/index.html @@ -0,0 +1,154 @@ + +Migrate_501_502 (ppxlib.Astlib.Migrate_501_502)

Module Astlib.Migrate_501_502

module From = Ast_501
module To = Ast_502
val extract_attr : + string -> + Ast_501.Parsetree.attributes -> + Ast_501.Parsetree.payload option * Ast_501.Parsetree.attribute list

Look for a particular attribute and remove it from the list. Attributes are used to make certain migrations round-trip. Returns None if the specified attribute is not found.

val migrate_ppx_context_load_path : + Ast_501.Parsetree.expression -> + Ast_501.Parsetree.expression
val migrate_ppx_context_payload : + Ast_501.Parsetree.payload -> + Ast_501.Parsetree.payload
val copy_class_infos : + 'f0 'g0. ('f0 -> 'g0) -> + 'f0 Ast_501.Parsetree.class_infos -> + 'g0 Ast_502.Parsetree.class_infos
val copy_include_infos : + 'f0 'g0. ('f0 -> 'g0) -> + 'f0 Ast_501.Parsetree.include_infos -> + 'g0 Ast_502.Parsetree.include_infos
val copy_open_infos : + 'f0 'g0. ('f0 -> 'g0) -> + 'f0 Ast_501.Parsetree.open_infos -> + 'g0 Ast_502.Parsetree.open_infos
val copy_Longident_t : Longident.t -> Longident.t
val copy_loc : + 'f0 'g0. ('f0 -> 'g0) -> + 'f0 Ast_501.Asttypes.loc -> + 'g0 Ast_502.Asttypes.loc
val copy_location : Location.t -> Location.t
\ No newline at end of file diff --git a/ppxlib/Astlib/Migrate_502_501/index.html b/ppxlib/Astlib/Migrate_502_501/index.html new file mode 100644 index 0000000..3f74fac --- /dev/null +++ b/ppxlib/Astlib/Migrate_502_501/index.html @@ -0,0 +1,154 @@ + +Migrate_502_501 (ppxlib.Astlib.Migrate_502_501)

Module Astlib.Migrate_502_501

module From = Ast_502
module To = Ast_501
val migration_error : Location.t -> string -> 'a
val mk_ghost_attr : string -> Ast_501.Parsetree.attribute
val migrate_ppx_context_load_path : + Ast_502.Parsetree.expression -> + Ast_502.Parsetree.expression
val migrate_ppx_context_payload : + Ast_502.Parsetree.payload -> + Ast_502.Parsetree.payload
val copy_class_infos : + 'f0 'g0. ('f0 -> 'g0) -> + 'f0 Ast_502.Parsetree.class_infos -> + 'g0 Ast_501.Parsetree.class_infos
val copy_include_infos : + 'f0 'g0. ('f0 -> 'g0) -> + 'f0 Ast_502.Parsetree.include_infos -> + 'g0 Ast_501.Parsetree.include_infos
val copy_open_infos : + 'f0 'g0. ('f0 -> 'g0) -> + 'f0 Ast_502.Parsetree.open_infos -> + 'g0 Ast_501.Parsetree.open_infos
val copy_Longident_t : Longident.t -> Longident.t
val copy_loc : + 'f0 'g0. ('f0 -> 'g0) -> + 'f0 Ast_502.Asttypes.loc -> + 'g0 Ast_501.Asttypes.loc
val copy_location : Location.t -> Location.t
\ No newline at end of file diff --git a/ppxlib/Astlib/Migrate_502_503/index.html b/ppxlib/Astlib/Migrate_502_503/index.html new file mode 100644 index 0000000..9b44d26 --- /dev/null +++ b/ppxlib/Astlib/Migrate_502_503/index.html @@ -0,0 +1,152 @@ + +Migrate_502_503 (ppxlib.Astlib.Migrate_502_503)

Module Astlib.Migrate_502_503

module From = Ast_502
module To = Ast_503
val copy_class_infos : + 'f0 'g0. ('f0 -> 'g0) -> + 'f0 Ast_502.Parsetree.class_infos -> + 'g0 Ast_503.Parsetree.class_infos
val copy_include_infos : + 'f0 'g0. ('f0 -> 'g0) -> + 'f0 Ast_502.Parsetree.include_infos -> + 'g0 Ast_503.Parsetree.include_infos
val copy_open_infos : + 'f0 'g0. ('f0 -> 'g0) -> + 'f0 Ast_502.Parsetree.open_infos -> + 'g0 Ast_503.Parsetree.open_infos
val copy_Longident_t : Longident.t -> Longident.t
val copy_loc : + 'f0 'g0. ('f0 -> 'g0) -> + 'f0 Ast_502.Asttypes.loc -> + 'g0 Ast_503.Asttypes.loc
val copy_location : Location.t -> Location.t
\ No newline at end of file diff --git a/ppxlib/Astlib/Migrate_503_502/index.html b/ppxlib/Astlib/Migrate_503_502/index.html new file mode 100644 index 0000000..983a346 --- /dev/null +++ b/ppxlib/Astlib/Migrate_503_502/index.html @@ -0,0 +1,153 @@ + +Migrate_503_502 (ppxlib.Astlib.Migrate_503_502)

Module Astlib.Migrate_503_502

module From = Ast_503
module To = Ast_502
val migration_error : Location.t -> string -> 'a
val copy_class_infos : + 'f0 'g0. ('f0 -> 'g0) -> + 'f0 Ast_503.Parsetree.class_infos -> + 'g0 Ast_502.Parsetree.class_infos
val copy_include_infos : + 'f0 'g0. ('f0 -> 'g0) -> + 'f0 Ast_503.Parsetree.include_infos -> + 'g0 Ast_502.Parsetree.include_infos
val copy_open_infos : + 'f0 'g0. ('f0 -> 'g0) -> + 'f0 Ast_503.Parsetree.open_infos -> + 'g0 Ast_502.Parsetree.open_infos
val copy_Longident_t : Longident.t -> Longident.t
val copy_loc : + 'f0 'g0. ('f0 -> 'g0) -> + 'f0 Ast_503.Asttypes.loc -> + 'g0 Ast_502.Asttypes.loc
val copy_location : Location.t -> Location.t
\ No newline at end of file diff --git a/ppxlib/Astlib/index.html b/ppxlib/Astlib/index.html index 5ddc7eb..d6988b9 100644 --- a/ppxlib/Astlib/index.html +++ b/ppxlib/Astlib/index.html @@ -1,2 +1,2 @@ -Astlib (ppxlib.Astlib)

Module Astlib

module Ast_402 : sig ... end
module Ast_403 : sig ... end
module Ast_404 : sig ... end
module Ast_405 : sig ... end
module Ast_406 : sig ... end
module Ast_407 : sig ... end
module Ast_408 : sig ... end
module Ast_409 : sig ... end
module Ast_410 : sig ... end
module Ast_411 : sig ... end
module Ast_412 : sig ... end
module Ast_413 : sig ... end
module Ast_414 : sig ... end
module Ast_500 : sig ... end
module Ast_501 : sig ... end
module Migrate_402_403 : sig ... end
module Migrate_403_402 : sig ... end
module Migrate_403_404 : sig ... end
module Migrate_404_403 : sig ... end
module Migrate_404_405 : sig ... end
module Migrate_405_404 : sig ... end
module Migrate_405_406 : sig ... end
module Migrate_406_405 : sig ... end
module Migrate_406_407 : sig ... end
module Migrate_407_406 : sig ... end
module Migrate_407_408 : sig ... end
module Migrate_408_407 : sig ... end
module Migrate_408_409 : sig ... end
module Migrate_409_408 : sig ... end
module Migrate_409_410 : sig ... end
module Migrate_410_409 : sig ... end
module Migrate_410_411 : sig ... end
module Migrate_411_410 : sig ... end
module Migrate_411_412 : sig ... end
module Migrate_412_411 : sig ... end
module Migrate_412_413 : sig ... end
module Migrate_413_412 : sig ... end
module Migrate_413_414 : sig ... end
module Migrate_414_413 : sig ... end
module Migrate_414_500 : sig ... end
module Migrate_500_414 : sig ... end
module Migrate_500_501 : sig ... end
module Migrate_501_500 : sig ... end
module Ast_metadata : sig ... end

Meta data related interface for a ppx rewriter

module Config : sig ... end

Magic numbers

module Keyword : sig ... end
module Location : sig ... end

Source code locations (ranges of positions), used in parsetrees

module Longident : sig ... end

Long identifiers, used in parsetrees.

module Parse : sig ... end

Entry points in the parser

module Pprintast : sig ... end
val init_error_reporting_style_using_env_vars : unit -> unit

Adjust the reporting style of error messages to the environment variables OCAML_COLOR and OCAML_ERROR_STYLE.

\ No newline at end of file +Astlib (ppxlib.Astlib)

Module Astlib

module Ast_402 : sig ... end
module Ast_403 : sig ... end
module Ast_404 : sig ... end
module Ast_405 : sig ... end
module Ast_406 : sig ... end
module Ast_407 : sig ... end
module Ast_408 : sig ... end
module Ast_409 : sig ... end
module Ast_410 : sig ... end
module Ast_411 : sig ... end
module Ast_412 : sig ... end
module Ast_413 : sig ... end
module Ast_414 : sig ... end
module Ast_500 : sig ... end
module Ast_501 : sig ... end
module Ast_502 : sig ... end
module Ast_503 : sig ... end
module Migrate_402_403 : sig ... end
module Migrate_403_402 : sig ... end
module Migrate_403_404 : sig ... end
module Migrate_404_403 : sig ... end
module Migrate_404_405 : sig ... end
module Migrate_405_404 : sig ... end
module Migrate_405_406 : sig ... end
module Migrate_406_405 : sig ... end
module Migrate_406_407 : sig ... end
module Migrate_407_406 : sig ... end
module Migrate_407_408 : sig ... end
module Migrate_408_407 : sig ... end
module Migrate_408_409 : sig ... end
module Migrate_409_408 : sig ... end
module Migrate_409_410 : sig ... end
module Migrate_410_409 : sig ... end
module Migrate_410_411 : sig ... end
module Migrate_411_410 : sig ... end
module Migrate_411_412 : sig ... end
module Migrate_412_411 : sig ... end
module Migrate_412_413 : sig ... end
module Migrate_413_412 : sig ... end
module Migrate_413_414 : sig ... end
module Migrate_414_413 : sig ... end
module Migrate_414_500 : sig ... end
module Migrate_500_414 : sig ... end
module Migrate_500_501 : sig ... end
module Migrate_501_500 : sig ... end
module Migrate_501_502 : sig ... end
module Migrate_502_501 : sig ... end
module Migrate_502_503 : sig ... end
module Migrate_503_502 : sig ... end
module Ast_metadata : sig ... end

Meta data related interface for a ppx rewriter

module Config : sig ... end

Magic numbers

module Keyword : sig ... end
module Location : sig ... end

Source code locations (ranges of positions), used in parsetrees

module Longident : sig ... end

Long identifiers, used in parsetrees.

module Parse : sig ... end

Entry points in the parser

module Pprintast : sig ... end
val init_error_reporting_style_using_env_vars : unit -> unit

Adjust the reporting style of error messages to the environment variables OCAML_COLOR and OCAML_ERROR_STYLE.

\ No newline at end of file diff --git a/ppxlib/Astlib__Ast_502/index.html b/ppxlib/Astlib__Ast_502/index.html new file mode 100644 index 0000000..c5fd204 --- /dev/null +++ b/ppxlib/Astlib__Ast_502/index.html @@ -0,0 +1,2 @@ + +Astlib__Ast_502 (ppxlib.Astlib__Ast_502)

Module Astlib__Ast_502

\ No newline at end of file diff --git a/ppxlib/Astlib__Ast_503/index.html b/ppxlib/Astlib__Ast_503/index.html new file mode 100644 index 0000000..d742103 --- /dev/null +++ b/ppxlib/Astlib__Ast_503/index.html @@ -0,0 +1,2 @@ + +Astlib__Ast_503 (ppxlib.Astlib__Ast_503)

Module Astlib__Ast_503

\ No newline at end of file diff --git a/ppxlib/Astlib__Migrate_501_502/index.html b/ppxlib/Astlib__Migrate_501_502/index.html new file mode 100644 index 0000000..9b26f9b --- /dev/null +++ b/ppxlib/Astlib__Migrate_501_502/index.html @@ -0,0 +1,2 @@ + +Astlib__Migrate_501_502 (ppxlib.Astlib__Migrate_501_502)

Module Astlib__Migrate_501_502

\ No newline at end of file diff --git a/ppxlib/Astlib__Migrate_502_501/index.html b/ppxlib/Astlib__Migrate_502_501/index.html new file mode 100644 index 0000000..968cc38 --- /dev/null +++ b/ppxlib/Astlib__Migrate_502_501/index.html @@ -0,0 +1,2 @@ + +Astlib__Migrate_502_501 (ppxlib.Astlib__Migrate_502_501)

Module Astlib__Migrate_502_501

\ No newline at end of file diff --git a/ppxlib/Astlib__Migrate_502_503/index.html b/ppxlib/Astlib__Migrate_502_503/index.html new file mode 100644 index 0000000..df58454 --- /dev/null +++ b/ppxlib/Astlib__Migrate_502_503/index.html @@ -0,0 +1,2 @@ + +Astlib__Migrate_502_503 (ppxlib.Astlib__Migrate_502_503)

Module Astlib__Migrate_502_503

\ No newline at end of file diff --git a/ppxlib/Astlib__Migrate_503_502/index.html b/ppxlib/Astlib__Migrate_503_502/index.html new file mode 100644 index 0000000..274dead --- /dev/null +++ b/ppxlib/Astlib__Migrate_503_502/index.html @@ -0,0 +1,2 @@ + +Astlib__Migrate_503_502 (ppxlib.Astlib__Migrate_503_502)

Module Astlib__Migrate_503_502

\ 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 33946df..b51aaf7 100644 --- a/ppxlib/Ppxlib/Ast_builder/Default/index.html +++ b/ppxlib/Ppxlib/Ast_builder/Default/index.html @@ -674,13 +674,21 @@ Astlib.Ast_500.Parsetree.pattern

elist_tail ~loc [expr1; expr2; expr3] expr_tail produces the expression expr1::expr2::expr3::expr_tail.

elist ~loc [expr1; expr2; expr3] produces the list litteral expression [expr1; expr2; expr3].

plist_tail ~loc [pat1; pat2; pat3] pat_tail produces the pattern pat1::pat2::pat3::pat_tail.

plist ~loc [pat1; pat2; pat3] produces the list pattern [pat1; pat2; pat3].

val pstr_value_list : loc:Location.t -> Ppxlib_ast.Asttypes.rec_flag -> Astlib.Ast_500.Parsetree.value_binding list -> diff --git a/ppxlib/Ppxlib/Ast_builder/Make/index.html b/ppxlib/Ppxlib/Ast_builder/Make/index.html index a018931..37b7ec0 100644 --- a/ppxlib/Ppxlib/Ast_builder/Make/index.html +++ b/ppxlib/Ppxlib/Ast_builder/Make/index.html @@ -483,11 +483,17 @@ Astlib.Ast_500.Parsetree.pattern

elist_tail ~loc [expr1; expr2; expr3] expr_tail produces the expression expr1::expr2::expr3::expr_tail.

elist ~loc [expr1; expr2; expr3] produces the list litteral expression [expr1; expr2; expr3].

plist_tail ~loc [pat1; pat2; pat3] pat_tail produces the pattern pat1::pat2::pat3::pat_tail.

plist ~loc [pat1; pat2; pat3] produces the list pattern [pat1; pat2; pat3].

val pstr_value_list : loc:Location.t -> Ppxlib_ast.Asttypes.rec_flag -> Astlib.Ast_500.Parsetree.value_binding list -> diff --git a/ppxlib/Ppxlib/Ast_builder/module-type-S/index.html b/ppxlib/Ppxlib/Ast_builder/module-type-S/index.html index 36297d6..aa643b6 100644 --- a/ppxlib/Ppxlib/Ast_builder/module-type-S/index.html +++ b/ppxlib/Ppxlib/Ast_builder/module-type-S/index.html @@ -483,11 +483,17 @@ Astlib.Ast_500.Parsetree.pattern

elist_tail ~loc [expr1; expr2; expr3] expr_tail produces the expression expr1::expr2::expr3::expr_tail.

elist ~loc [expr1; expr2; expr3] produces the list litteral expression [expr1; expr2; expr3].

plist_tail ~loc [pat1; pat2; pat3] pat_tail produces the pattern pat1::pat2::pat3::pat_tail.

plist ~loc [pat1; pat2; pat3] produces the list pattern [pat1; pat2; pat3].

val pstr_value_list : loc:Location.t -> Ppxlib_ast.Asttypes.rec_flag -> Astlib.Ast_500.Parsetree.value_binding list -> diff --git a/ppxlib/Ppxlib/Context_free/Rule/index.html b/ppxlib/Ppxlib/Context_free/Rule/index.html index 4a2cd10..0250431 100644 --- a/ppxlib/Ppxlib/Context_free/Rule/index.html +++ b/ppxlib/Ppxlib/Context_free/Rule/index.html @@ -3,7 +3,11 @@ string -> (Astlib.Ast_500.Parsetree.expression -> Astlib.Ast_500.Parsetree.expression option) -> - t

special_function id expand is a rule to rewrite a function call at parsing time. id is the identifier to match on and expand is used to expand the full function application (it gets the Pexp_apply node). If the function is found in the tree without being applied, expand gets only the identifier (Pexp_ident node) so you should handle both cases.

If id is an operator identifier and contains dots, it should be parenthesized (e.g. "(+.+)").

expand must decide whether the expression it receive can be rewritten or not. Especially ppxlib makes the assumption that expand is idempotent. It will loop if it is not.

module Constant_kind : sig ... end

Used for the constant function.

val constant : + t

special_function id expand is a rule to rewrite a function call at parsing time. id is the identifier to match on and expand is used to expand the full function application (it gets the Pexp_apply node). If the function is found in the tree without being applied, expand gets only the identifier (Pexp_ident node) so you should handle both cases.

If id is an operator identifier and contains dots, it should be parenthesized (e.g. "(+.+)"). Another option is to use the special_function' variant which takes directly a Longident.t argument.

expand must decide whether the expression it receive can be rewritten or not. Especially ppxlib makes the assumption that expand is idempotent. It will loop if it is not.

module Constant_kind : sig ... end

Used for the constant function.

val constant : Constant_kind.t -> char -> (Location.t -> string -> Ppxlib_ast.Parsetree.expression) -> diff --git a/ppxlib/Stdppx/index.html b/ppxlib/Stdppx/index.html index 8715c71..305b127 100644 --- a/ppxlib/Stdppx/index.html +++ b/ppxlib/Stdppx/index.html @@ -1,5 +1,5 @@ -Stdppx (ppxlib.Stdppx)

Module Stdppx

module Caml = Stdlib
module Sexp = Sexplib0.Sexp
module Sexpable = Sexplib0.Sexpable
include module type of struct include Sexplib0.Sexp_conv end
Conversion of OCaml-values to S-expressions
val default_string_of_float : (float -> string) ref

default_string_of_float reference to the default function used to convert floats to strings.

Initially set to fun n -> sprintf "%.20G" n.

val write_old_option_format : bool ref

write_old_option_format reference for the default option format used to write option values. If set to true, the old-style option format will be used, the new-style one otherwise.

Initially set to true.

val read_old_option_format : bool ref

read_old_option_format reference for the default option format used to read option values. Of_sexp_error will be raised with old-style option values if this reference is set to false. Reading new-style option values is always supported. Using a global reference instead of changing the converter calling conventions is the only way to avoid breaking old code with the standard macros.

Initially set to true.

val list_map : ('a -> 'b) -> 'a list -> 'b list

We re-export a tail recursive map function, because some modules override the standard library functions (e.g. StdLabels) which wrecks havoc with the camlp4 extension.

val sexp_of_unit : unit -> Sexplib0.Sexp.t

sexp_of_unit () converts a value of type unit to an S-expression.

val sexp_of_bool : bool -> Sexplib0.Sexp.t

sexp_of_bool b converts the value x of type bool to an S-expression.

val sexp_of_string : string -> Sexplib0.Sexp.t

sexp_of_bool str converts the value str of type string to an S-expression.

val sexp_of_bytes : bytes -> Sexplib0.Sexp.t

sexp_of_bool str converts the value str of type bytes to an S-expression.

val sexp_of_char : char -> Sexplib0.Sexp.t

sexp_of_char c converts the value c of type char to an S-expression.

val sexp_of_int : int -> Sexplib0.Sexp.t

sexp_of_int n converts the value n of type int to an S-expression.

val sexp_of_float : float -> Sexplib0.Sexp.t

sexp_of_float n converts the value n of type float to an S-expression.

val sexp_of_int32 : int32 -> Sexplib0.Sexp.t

sexp_of_int32 n converts the value n of type int32 to an S-expression.

val sexp_of_int64 : int64 -> Sexplib0.Sexp.t

sexp_of_int64 n converts the value n of type int64 to an S-expression.

val sexp_of_nativeint : nativeint -> Sexplib0.Sexp.t

sexp_of_nativeint n converts the value n of type nativeint to an S-expression.

val sexp_of_ref : ('a -> Sexplib0.Sexp.t) -> 'a ref -> Sexplib0.Sexp.t

sexp_of_ref conv r converts the value r of type 'a ref to an S-expression. Uses conv to convert values of type 'a to an S-expression.

val sexp_of_lazy_t : ('a -> Sexplib0.Sexp.t) -> 'a lazy_t -> Sexplib0.Sexp.t

sexp_of_lazy_t conv l converts the value l of type 'a lazy_t to an S-expression. Uses conv to convert values of type 'a to an S-expression.

val sexp_of_option : ('a -> Sexplib0.Sexp.t) -> 'a option -> Sexplib0.Sexp.t

sexp_of_option conv opt converts the value opt of type 'a +Stdppx (ppxlib.Stdppx)

Module Stdppx

module Caml = Stdlib
module Sexp = Sexplib0.Sexp
module Sexpable = Sexplib0.Sexpable
include module type of struct include Sexplib0.Sexp_conv end
Conversion of OCaml-values to S-expressions
val default_string_of_float : (float -> string) ref

default_string_of_float reference to the default function used to convert floats to strings.

Initially set to fun n -> sprintf "%.20G" n.

val write_old_option_format : bool ref

write_old_option_format reference for the default option format used to write option values. If set to true, the old-style option format will be used, the new-style one otherwise.

Initially set to true.

val read_old_option_format : bool ref

read_old_option_format reference for the default option format used to read option values. Of_sexp_error will be raised with old-style option values if this reference is set to false. Reading new-style option values is always supported. Using a global reference instead of changing the converter calling conventions is the only way to avoid breaking old code with the standard macros.

Initially set to true.

val list_map : ('a -> 'b) -> 'a list -> 'b list

We re-export a tail recursive map function, because some modules override the standard library functions (e.g. StdLabels) which wrecks havoc with the camlp4 extension.

val sexp_of_unit : unit -> Sexplib0.Sexp.t

sexp_of_unit () converts a value of type unit to an S-expression.

val sexp_of_bool : bool -> Sexplib0.Sexp.t

sexp_of_bool b converts the value x of type bool to an S-expression.

val sexp_of_string : string -> Sexplib0.Sexp.t

sexp_of_string str converts the value str of type string to an S-expression.

val sexp_of_bytes : bytes -> Sexplib0.Sexp.t

sexp_of_bytes str converts the value str of type bytes to an S-expression.

val sexp_of_char : char -> Sexplib0.Sexp.t

sexp_of_char c converts the value c of type char to an S-expression.

val sexp_of_int : int -> Sexplib0.Sexp.t

sexp_of_int n converts the value n of type int to an S-expression.

val sexp_of_float : float -> Sexplib0.Sexp.t

sexp_of_float n converts the value n of type float to an S-expression.

val sexp_of_int32 : int32 -> Sexplib0.Sexp.t

sexp_of_int32 n converts the value n of type int32 to an S-expression.

val sexp_of_int64 : int64 -> Sexplib0.Sexp.t

sexp_of_int64 n converts the value n of type int64 to an S-expression.

val sexp_of_nativeint : nativeint -> Sexplib0.Sexp.t

sexp_of_nativeint n converts the value n of type nativeint to an S-expression.

val sexp_of_ref : ('a -> Sexplib0.Sexp.t) -> 'a ref -> Sexplib0.Sexp.t

sexp_of_ref conv r converts the value r of type 'a ref to an S-expression. Uses conv to convert values of type 'a to an S-expression.

val sexp_of_lazy_t : ('a -> Sexplib0.Sexp.t) -> 'a lazy_t -> Sexplib0.Sexp.t

sexp_of_lazy_t conv l converts the value l of type 'a lazy_t to an S-expression. Uses conv to convert values of type 'a to an S-expression.

val sexp_of_option : ('a -> Sexplib0.Sexp.t) -> 'a option -> Sexplib0.Sexp.t

sexp_of_option conv opt converts the value opt of type 'a option to an S-expression. Uses conv to convert values of type 'a to an S-expression.

val sexp_of_pair : ('a -> Sexplib0.Sexp.t) -> ('b -> Sexplib0.Sexp.t) -> diff --git a/ppxlib/_doc-dir/CHANGES.md b/ppxlib/_doc-dir/CHANGES.md index c9b05cb..41933b9 100644 --- a/ppxlib/_doc-dir/CHANGES.md +++ b/ppxlib/_doc-dir/CHANGES.md @@ -1,3 +1,47 @@ +0.33.0 (2024-07-22) +------------------- + +- Fix a bug where `Code_path.main_module_name` would not properly remove + extensions from the filename and therefore return an invalid module name. + (#512, @NathanReb) + +- Add `-unused-type-warnings` flag to the driver to allow users to disable + only the generation of warning 34 silencing structure items when using + `[@@deriving ...]` on type declarations. (#511, @mbarbin, @NathanReb) + +- Make `-unused-code-warnings` flag to the driver also controls the generation + of warning 34 silencing structure items when using `[@@deriving ...]` on type + declarations. (#510, @mbarbin, @NathanReb) + +- Driver: Add `-unused-code-warnings=force` command-line flag argument. (#490, @mbarbin) + +- new functions `Ast_builder.{e,p}list_tail` that take an extra tail + expression/pattern argument parameter compared to `Ast_builder.{e,p}list`, so + they can build ASTs like `a :: b :: c` instead of only `[ a; b ]`. + (#498, #502, @v-gb, @NathanReb) + +- Fix `Longident.parse` so it also handles indexing operators such as + `.!()`, `.%(;..)<-`, or `Vec.(.%())` (#494, @octachron) + +- Add a `special_function'` variant which directly takes a `Longident.t` + argument to avoid the issue that `Longident.t` cover distinct syntaxic classes + which cannot be easily parsed by a common parser (#496, @octachron). + +- Keep location ranges consistent when migrating `Pexp_function` nodes from 5.2+ + to older versions (#504, @jchavarri) + +- Fix `-locations-check` behaviour so it is no longer required to pass `-check` + as well to enable location checks. (#506, @NathanReb) + + +0.32.1 (2024-04-23) +------------------- + +- Add support for OCaml 5.2 + +- Insert errors from caught located exceptions in place of the code that + should have been generated by context-free rules. (#472, @NathanReb) + 0.32.0 (2024-02-05) ------------------- diff --git a/ppxlib/_doc-dir/README.md b/ppxlib/_doc-dir/README.md index f73fc48..612b5b6 100644 --- a/ppxlib/_doc-dir/README.md +++ b/ppxlib/_doc-dir/README.md @@ -1,11 +1,13 @@ # Ppxlib - Meta-programming for OCaml -[![ocaml-ci status][ocaml-ci-img]][ocaml-ci] [![AppVeyor status][appveyor-img]][appveyor] +[![ocaml-ci status][ocaml-ci-img]][ocaml-ci] [![trunk-build-status][trunk-build-img]][trunk-build] [![AppVeyor status][appveyor-img]][appveyor] [ocaml-ci]: https://ci.ocamllabs.io/github/ocaml-ppx/ppxlib [ocaml-ci-img]: https://img.shields.io/endpoint?url=https%3A%2F%2Fci.ocamllabs.io%2Fbadge%2Focaml-ppx%2Fppxlib%2Fmain&logo=ocaml [appveyor]: https://ci.appveyor.com/project/diml/ppxlib/branch/main [appveyor-img]: https://ci.appveyor.com/api/projects/status/bogbsm33uvh083jx?svg=true +[trunk-build]: https://github.com/ocaml-ppx/ppxlib/actions/workflows/trunk-build.yml +[trunk-build-img]: https://github.com/ocaml-ppx/ppxlib/actions/workflows/trunk-build.yml/badge.svg?branch=main [Ppxlib documentation][doc] diff --git a/ppxlib/_doc-dir/odoc-pages/driver.mld b/ppxlib/_doc-dir/odoc-pages/driver.mld index f49aa28..7f4d7a7 100644 --- a/ppxlib/_doc-dir/odoc-pages/driver.mld +++ b/ppxlib/_doc-dir/odoc-pages/driver.mld @@ -91,8 +91,23 @@ driver.exe [extra_args] [] -no-merge Do not merge context free transformations (better for debugging rewriters). As a result, the context-free transformations are not all applied before all impl and intf. -cookie NAME=EXPR Set the cookie NAME to EXPR --cookie Same as -cookie - -help Display this list of options - --help Display this list of options + -deriving-keep-w32 {impl|intf|both} + Do not try to disable warning 32 for the generated code + -deriving-disable-w32-method {code|attribute} + How to disable warning 32 for the generated code + -type-conv-keep-w32 {impl|intf|both} + Deprecated, use -deriving-keep-w32 + -type-conv-w32 {code|attribute} + Deprecated, use -deriving-disable-w32-method + -deriving-keep-w60 {impl|intf|both} + Do not try to disable warning 60 for the generated code + -unused-code-warnings {true|false|force} + Allow ppx derivers to enable unused code warnings (default: false) + -unused-type-warnings {true|false|force} + Allow unused type warnings for types with [@@deriving ...] (default: false) + -help Display this list of options + --help Display this list of options + v} {%html:
%} diff --git a/ppxlib/driver.html b/ppxlib/driver.html index 8a5b21d..e6653e2 100644 --- a/ppxlib/driver.html +++ b/ppxlib/driver.html @@ -41,8 +41,22 @@ -no-merge Do not merge context free transformations (better for debugging rewriters). As a result, the context-free transformations are not all applied before all impl and intf. -cookie NAME=EXPR Set the cookie NAME to EXPR --cookie Same as -cookie - -help Display this list of options - --help Display this list of options

and

Ppx rewriter driver
driver.exe [extra_args] <infile> <outfile>
+  -deriving-keep-w32 {impl|intf|both}
+                               Do not try to disable warning 32 for the generated code
+  -deriving-disable-w32-method {code|attribute}
+                               How to disable warning 32 for the generated code
+  -type-conv-keep-w32 {impl|intf|both}
+                               Deprecated, use -deriving-keep-w32
+  -type-conv-w32 {code|attribute}
+                               Deprecated, use -deriving-disable-w32-method
+  -deriving-keep-w60 {impl|intf|both}
+                               Do not try to disable warning 60 for the generated code
+  -unused-code-warnings {true|false|force}
+                               Allow ppx derivers to enable unused code warnings (default: false)
+  -unused-type-warnings {true|false|force}
+                               Allow unused type warnings for types with [@@deriving ...] (default: false)
+  -help                        Display this list of options
+  --help                       Display this list of options

and

Ppx rewriter driver
driver.exe [extra_args] <infile> <outfile>
   -loc-filename <string>      File name to use in locations
   -reserve-namespace <string> Mark the given namespace as reserved
   -no-check                   Disable checks (unsafe)
diff --git a/sexplib0/Sexplib0/Sexp_conv/index.html b/sexplib0/Sexplib0/Sexp_conv/index.html
index 4a9fd79..0cbaaf1 100644
--- a/sexplib0/Sexplib0/Sexp_conv/index.html
+++ b/sexplib0/Sexplib0/Sexp_conv/index.html
@@ -1,5 +1,5 @@
 
-Sexp_conv (sexplib0.Sexplib0.Sexp_conv)

Module Sexplib0.Sexp_conv

Utility Module for S-expression Conversions

Conversion of OCaml-values to S-expressions
val default_string_of_float : (float -> string) ref

default_string_of_float reference to the default function used to convert floats to strings.

Initially set to fun n -> sprintf "%.20G" n.

val write_old_option_format : bool ref

write_old_option_format reference for the default option format used to write option values. If set to true, the old-style option format will be used, the new-style one otherwise.

Initially set to true.

val read_old_option_format : bool ref

read_old_option_format reference for the default option format used to read option values. Of_sexp_error will be raised with old-style option values if this reference is set to false. Reading new-style option values is always supported. Using a global reference instead of changing the converter calling conventions is the only way to avoid breaking old code with the standard macros.

Initially set to true.

val list_map : ('a -> 'b) -> 'a list -> 'b list

We re-export a tail recursive map function, because some modules override the standard library functions (e.g. StdLabels) which wrecks havoc with the camlp4 extension.

val sexp_of_unit : unit -> Sexp.t

sexp_of_unit () converts a value of type unit to an S-expression.

val sexp_of_bool : bool -> Sexp.t

sexp_of_bool b converts the value x of type bool to an S-expression.

val sexp_of_string : string -> Sexp.t

sexp_of_bool str converts the value str of type string to an S-expression.

val sexp_of_bytes : bytes -> Sexp.t

sexp_of_bool str converts the value str of type bytes to an S-expression.

val sexp_of_char : char -> Sexp.t

sexp_of_char c converts the value c of type char to an S-expression.

val sexp_of_int : int -> Sexp.t

sexp_of_int n converts the value n of type int to an S-expression.

val sexp_of_float : float -> Sexp.t

sexp_of_float n converts the value n of type float to an S-expression.

val sexp_of_int32 : int32 -> Sexp.t

sexp_of_int32 n converts the value n of type int32 to an S-expression.

val sexp_of_int64 : int64 -> Sexp.t

sexp_of_int64 n converts the value n of type int64 to an S-expression.

val sexp_of_nativeint : nativeint -> Sexp.t

sexp_of_nativeint n converts the value n of type nativeint to an S-expression.

val sexp_of_ref : ('a -> Sexp.t) -> 'a ref -> Sexp.t

sexp_of_ref conv r converts the value r of type 'a ref to an S-expression. Uses conv to convert values of type 'a to an S-expression.

val sexp_of_lazy_t : ('a -> Sexp.t) -> 'a lazy_t -> Sexp.t

sexp_of_lazy_t conv l converts the value l of type 'a lazy_t to an S-expression. Uses conv to convert values of type 'a to an S-expression.

val sexp_of_option : ('a -> Sexp.t) -> 'a option -> Sexp.t

sexp_of_option conv opt converts the value opt of type 'a +Sexp_conv (sexplib0.Sexplib0.Sexp_conv)

Module Sexplib0.Sexp_conv

Utility Module for S-expression Conversions

Conversion of OCaml-values to S-expressions
val default_string_of_float : (float -> string) ref

default_string_of_float reference to the default function used to convert floats to strings.

Initially set to fun n -> sprintf "%.20G" n.

val write_old_option_format : bool ref

write_old_option_format reference for the default option format used to write option values. If set to true, the old-style option format will be used, the new-style one otherwise.

Initially set to true.

val read_old_option_format : bool ref

read_old_option_format reference for the default option format used to read option values. Of_sexp_error will be raised with old-style option values if this reference is set to false. Reading new-style option values is always supported. Using a global reference instead of changing the converter calling conventions is the only way to avoid breaking old code with the standard macros.

Initially set to true.

val list_map : ('a -> 'b) -> 'a list -> 'b list

We re-export a tail recursive map function, because some modules override the standard library functions (e.g. StdLabels) which wrecks havoc with the camlp4 extension.

val sexp_of_unit : unit -> Sexp.t

sexp_of_unit () converts a value of type unit to an S-expression.

val sexp_of_bool : bool -> Sexp.t

sexp_of_bool b converts the value x of type bool to an S-expression.

val sexp_of_string : string -> Sexp.t

sexp_of_string str converts the value str of type string to an S-expression.

val sexp_of_bytes : bytes -> Sexp.t

sexp_of_bytes str converts the value str of type bytes to an S-expression.

val sexp_of_char : char -> Sexp.t

sexp_of_char c converts the value c of type char to an S-expression.

val sexp_of_int : int -> Sexp.t

sexp_of_int n converts the value n of type int to an S-expression.

val sexp_of_float : float -> Sexp.t

sexp_of_float n converts the value n of type float to an S-expression.

val sexp_of_int32 : int32 -> Sexp.t

sexp_of_int32 n converts the value n of type int32 to an S-expression.

val sexp_of_int64 : int64 -> Sexp.t

sexp_of_int64 n converts the value n of type int64 to an S-expression.

val sexp_of_nativeint : nativeint -> Sexp.t

sexp_of_nativeint n converts the value n of type nativeint to an S-expression.

val sexp_of_ref : ('a -> Sexp.t) -> 'a ref -> Sexp.t

sexp_of_ref conv r converts the value r of type 'a ref to an S-expression. Uses conv to convert values of type 'a to an S-expression.

val sexp_of_lazy_t : ('a -> Sexp.t) -> 'a lazy_t -> Sexp.t

sexp_of_lazy_t conv l converts the value l of type 'a lazy_t to an S-expression. Uses conv to convert values of type 'a to an S-expression.

val sexp_of_option : ('a -> Sexp.t) -> 'a option -> Sexp.t

sexp_of_option conv opt converts the value opt of type 'a option to an S-expression. Uses conv to convert values of type 'a to an S-expression.

val sexp_of_pair : ('a -> Sexp.t) -> ('b -> Sexp.t) -> ('a * 'b) -> Sexp.t

sexp_of_pair conv1 conv2 pair converts a pair to an S-expression. It uses its first argument to convert the first element of the pair, and its second argument to convert the second element of the pair.

val sexp_of_triple : ('a -> Sexp.t) -> ('b -> Sexp.t) -> diff --git a/sexplib0/Sexplib0/Sexp_conv_error/index.html b/sexplib0/Sexplib0/Sexp_conv_error/index.html index fa14cce..38bfa32 100644 --- a/sexplib0/Sexplib0/Sexp_conv_error/index.html +++ b/sexplib0/Sexplib0/Sexp_conv_error/index.html @@ -1,5 +1,5 @@ -Sexp_conv_error (sexplib0.Sexplib0.Sexp_conv_error)

Module Sexplib0.Sexp_conv_error

exception Of_sexp_error of exn * Sexp.t
val tuple_of_size_n_expected : string -> int -> Sexp.t -> 'a
val stag_no_args : string -> Sexp.t -> 'a
val stag_incorrect_n_args : string -> string -> Sexp.t -> 'a
val stag_takes_args : string -> Sexp.t -> 'a
val nested_list_invalid_sum : string -> Sexp.t -> 'a
val empty_list_invalid_sum : string -> Sexp.t -> 'a
val unexpected_stag : string -> Sexp.t -> 'a
val record_sexp_bool_with_payload : string -> Sexp.t -> 'a
val record_only_pairs_expected : string -> Sexp.t -> 'a
val record_superfluous_fields : +Sexp_conv_error (sexplib0.Sexplib0.Sexp_conv_error)

Module Sexplib0.Sexp_conv_error

exception Of_sexp_error of exn * Sexp.t
val error : loc:string -> sexp:Sexp.t -> string -> 'a
val simple_error : string -> string -> Sexp.t -> 'a
val tuple_of_size_n_expected : string -> int -> Sexp.t -> 'a
val tuple_pair_expected : string -> string -> Sexp.t -> 'a
val tuple_incorrect_label : string -> string -> int -> Sexp.t -> 'a
val stag_no_args : string -> Sexp.t -> 'a
val stag_incorrect_n_args : string -> string -> Sexp.t -> 'a
val stag_takes_args : string -> Sexp.t -> 'a
val nested_list_invalid_sum : string -> Sexp.t -> 'a
val empty_list_invalid_sum : string -> Sexp.t -> 'a
val unexpected_stag : string -> Sexp.t -> 'a
val record_sexp_bool_with_payload : string -> Sexp.t -> 'a
val record_only_pairs_expected : string -> Sexp.t -> 'a
val record_invalid_fields : what:string -> loc:string -> string list -> diff --git a/sexplib0/Sexplib0/Sexp_conv_labeled_tuple/Fields/index.html b/sexplib0/Sexplib0/Sexp_conv_labeled_tuple/Fields/index.html new file mode 100644 index 0000000..613243e --- /dev/null +++ b/sexplib0/Sexplib0/Sexp_conv_labeled_tuple/Fields/index.html @@ -0,0 +1,2 @@ + +Fields (sexplib0.Sexplib0.Sexp_conv_labeled_tuple.Fields)

Module Sexp_conv_labeled_tuple.Fields

type _ t =
  1. | Field : {
    1. name : string;
    2. conv : Sexp.t -> 'a;
    3. rest : 'b t;
    } -> ('a * 'b) t
  2. | Empty : unit t
\ No newline at end of file diff --git a/sexplib0/Sexplib0/Sexp_conv_labeled_tuple/index.html b/sexplib0/Sexplib0/Sexp_conv_labeled_tuple/index.html new file mode 100644 index 0000000..5a6f093 --- /dev/null +++ b/sexplib0/Sexplib0/Sexp_conv_labeled_tuple/index.html @@ -0,0 +1,7 @@ + +Sexp_conv_labeled_tuple (sexplib0.Sexplib0.Sexp_conv_labeled_tuple)

Module Sexplib0.Sexp_conv_labeled_tuple

module Fields : sig ... end
val labeled_tuple_of_sexp : + caller:string -> + fields:'a Fields.t -> + create:('a -> 'b) -> + Sexp.t -> + 'b
\ No newline at end of file diff --git a/sexplib0/Sexplib0/index.html b/sexplib0/Sexplib0/index.html index c756d4f..c1f31d2 100644 --- a/sexplib0/Sexplib0/index.html +++ b/sexplib0/Sexplib0/index.html @@ -1,2 +1,2 @@ -Sexplib0 (sexplib0.Sexplib0)

Module Sexplib0

module Sexp : sig ... end

Type of S-expressions

module Sexp_conv : sig ... end

Utility Module for S-expression Conversions

module Sexp_conv_error : sig ... end
module Sexp_conv_record : sig ... end
module Sexp_grammar : sig ... end

Representation of S-expression grammars

module Sexpable : sig ... end
\ No newline at end of file +Sexplib0 (sexplib0.Sexplib0)

Module Sexplib0

module Sexp : sig ... end

Type of S-expressions

module Sexp_conv : sig ... end

Utility Module for S-expression Conversions

module Sexp_conv_error : sig ... end
module Sexp_conv_record : sig ... end
module Sexp_conv_labeled_tuple : sig ... end
module Sexp_grammar : sig ... end

Representation of S-expression grammars

module Sexpable : sig ... end
\ No newline at end of file diff --git a/sexplib0/Sexplib0__Sexp_conv_labeled_tuple/index.html b/sexplib0/Sexplib0__Sexp_conv_labeled_tuple/index.html new file mode 100644 index 0000000..0b77cfc --- /dev/null +++ b/sexplib0/Sexplib0__Sexp_conv_labeled_tuple/index.html @@ -0,0 +1,2 @@ + +Sexplib0__Sexp_conv_labeled_tuple (sexplib0.Sexplib0__Sexp_conv_labeled_tuple)

Module Sexplib0__Sexp_conv_labeled_tuple

\ No newline at end of file diff --git a/sexplib0/_doc-dir/CHANGES.md b/sexplib0/_doc-dir/CHANGES.md index fdf7d1a..d9c4327 100644 --- a/sexplib0/_doc-dir/CHANGES.md +++ b/sexplib0/_doc-dir/CHANGES.md @@ -1,3 +1,14 @@ +## Release v0.17.0 + +* Add a test that `Sexp.to_string` works on large input. + +* Improve error messages produced by `Sexp_conv` + +* Use `[@tail_mod_cons]` in `sexp_of_list`. + +* Add support for labeled tuples, a compiler extension available at: + https://github.com/ocaml-flambda/flambda-backend + ## Release v0.16.0 * Added `Sexp_conv_record`. Supports improvements to `ppx_sexp_conv` for deriving diff --git a/sexplib0/_doc-dir/LICENSE.md b/sexplib0/_doc-dir/LICENSE.md index 8c3a411..6fd223c 100644 --- a/sexplib0/_doc-dir/LICENSE.md +++ b/sexplib0/_doc-dir/LICENSE.md @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2005--2023 Jane Street Group, LLC +Copyright (c) 2005--2024 Jane Street Group, LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/trace-tef/Trace_tef__/index.html b/trace-tef/Trace_tef__/index.html new file mode 100644 index 0000000..92c7a3e --- /dev/null +++ b/trace-tef/Trace_tef__/index.html @@ -0,0 +1,2 @@ + +Trace_tef__ (trace-tef.Trace_tef__)

Module Trace_tef__

\ No newline at end of file diff --git a/trace-tef/Trace_tef__Event/index.html b/trace-tef/Trace_tef__Event/index.html new file mode 100644 index 0000000..1b6c838 --- /dev/null +++ b/trace-tef/Trace_tef__Event/index.html @@ -0,0 +1,2 @@ + +Trace_tef__Event (trace-tef.Trace_tef__Event)

Module Trace_tef__Event

\ No newline at end of file diff --git a/trace-tef/Trace_tef_tldrs/index.html b/trace-tef/Trace_tef_tldrs/index.html new file mode 100644 index 0000000..e24da30 --- /dev/null +++ b/trace-tef/Trace_tef_tldrs/index.html @@ -0,0 +1,2 @@ + +Trace_tef_tldrs (trace-tef.Trace_tef_tldrs)

Module Trace_tef_tldrs

val collector : out:[ `File of string ] -> unit -> Trace_core.collector

Make a collector that writes into the given output. See setup for more details.

type output = [
  1. | `File of string
]

Output for tracing.

  • `File "foo" will enable tracing and print events into file named "foo". The file is only written at exit.
val setup : ?out:[ output | `Env ] -> unit -> unit

setup () installs the collector depending on out.

  • parameter out

    can take different values:

    • regular output value to specify where events go
    • `Env will enable tracing if the environment variable "TRACE" is set.
    • If it's set to "1", then the file is "trace.json".
    • If it's set to "stdout", then logging happens on stdout (since 0.2)
    • If it's set to "stderr", then logging happens on stdout (since 0.2)
    • Otherwise, if it's set to a non empty string, the value is taken to be the file path into which to write.
val with_setup : ?out:[ output | `Env ] -> unit -> (unit -> 'a) -> 'a

with_setup () f (optionally) sets a collector up, calls f(), and makes sure to shutdown before exiting.

\ No newline at end of file diff --git a/trace-tef/index.html b/trace-tef/index.html index 87bba1c..4ca9b76 100644 --- a/trace-tef/index.html +++ b/trace-tef/index.html @@ -1,2 +1,2 @@ -index (trace-tef.index)

Package trace-tef

Package info

changes-files
readme-files
\ No newline at end of file +index (trace-tef.index)

Package trace-tef

Package info

changes-files
readme-files
\ No newline at end of file