| 1 |
abate |
233 |
open Ident
|
| 2 |
abate |
691 |
open Location
|
| 3 |
abate |
233 |
|
| 4 |
abate |
9 |
exception NonExhaustive of Types.descr
|
| 5 |
abate |
421 |
exception Constraint of Types.descr * Types.descr
|
| 6 |
abate |
19 |
exception ShouldHave of Types.descr * string
|
| 7 |
abate |
233 |
exception WrongLabel of Types.descr * label
|
| 8 |
abate |
656 |
exception UnboundId of id * bool
|
| 9 |
abate |
355 |
exception ShouldHave2 of Types.descr * string * Types.descr
|
| 10 |
abate |
421 |
exception Error of string
|
| 11 |
abate |
691 |
val warning: loc -> string -> unit
|
| 12 |
|
|
val error: loc -> string -> 'a
|
| 13 |
abate |
5 |
|
| 14 |
abate |
691 |
include Custom.T
|
| 15 |
abate |
677 |
|
| 16 |
abate |
691 |
val empty_env: t
|
| 17 |
|
|
val get_ns_table : t -> Ns.table
|
| 18 |
abate |
542 |
|
| 19 |
abate |
691 |
val enter_ns : U.t -> Ns.t -> t -> t
|
| 20 |
abate |
421 |
|
| 21 |
abate |
691 |
val enter_value: id -> Types.t -> t -> t
|
| 22 |
|
|
val enter_values: (id * Types.t) list -> t -> t
|
| 23 |
|
|
val find_value: id -> t -> Types.t
|
| 24 |
abate |
553 |
|
| 25 |
abate |
691 |
val enter_type: id -> Types.t -> t -> t
|
| 26 |
|
|
val enter_types: (id * Types.t) list -> t -> t
|
| 27 |
|
|
val find_type: id -> t -> Types.t
|
| 28 |
abate |
6 |
|
| 29 |
abate |
691 |
val type_defs: t -> (id * Ast.ppat) list -> (id * Types.t) list
|
| 30 |
|
|
val typ: t -> Ast.ppat -> Types.Node.t
|
| 31 |
|
|
val pat: t -> Ast.ppat -> Patterns.node
|
| 32 |
abate |
529 |
|
| 33 |
abate |
691 |
val dump_types: Format.formatter -> t -> unit
|
| 34 |
abate |
686 |
|
| 35 |
abate |
691 |
|
| 36 |
|
|
|
| 37 |
|
|
val dump_ns: Format.formatter -> t -> unit
|
| 38 |
|
|
val set_ns_table_for_printer: t -> unit
|
| 39 |
|
|
|
| 40 |
|
|
val expr: t -> Ast.pexpr -> fv * Typed.texpr
|
| 41 |
|
|
val let_decl : t -> Ast.ppat -> Ast.pexpr -> Typed.let_decl
|
| 42 |
|
|
|
| 43 |
abate |
19 |
val type_check:
|
| 44 |
abate |
691 |
t -> Typed.texpr -> Types.descr -> bool -> Types.descr
|
| 45 |
abate |
421 |
(* [type_check env e t precise] checks that expression [e]
|
| 46 |
abate |
19 |
has type [t] under typing environment [env]; if [precise=true],
|
| 47 |
|
|
also returns a possible more precise type for [e].
|
| 48 |
|
|
*)
|
| 49 |
abate |
691 |
val type_let_decl: t -> Typed.let_decl -> (id * Types.t) list
|
| 50 |
abate |
19 |
|
| 51 |
abate |
691 |
val type_rec_funs: t -> Typed.texpr list -> (id * Types.t) list
|
| 52 |
abate |
421 |
(* Assume that all the expressions are Abstractions *)
|
| 53 |
abate |
314 |
|
| 54 |
|
|
val report_unused_branches : unit -> unit
|
| 55 |
|
|
(* Issue warnings for unused branches *)
|
| 56 |
abate |
637 |
val clear_unused_branches : unit -> unit
|
| 57 |
abate |
421 |
|
| 58 |
abate |
691 |
val flatten: loc ->
|
| 59 |
abate |
686 |
(Types.t -> bool -> Types.t) -> (Types.t -> bool -> Types.t)
|
| 60 |
abate |
431 |
|
| 61 |
abate |
501 |
(** {2 Schema stuff} *)
|
| 62 |
abate |
431 |
|
| 63 |
abate |
501 |
(** register a schema *)
|
| 64 |
|
|
val register_schema: string -> Schema_types.schema -> unit
|
| 65 |
abate |
431 |
|
| 66 |
abate |
501 |
(** @return the validator for a Schema global element *)
|
| 67 |
|
|
val get_schema_validator: string * string -> Schema_validator.validator
|
| 68 |
|
|
|
| 69 |
|
|
(** DEBUG ONLY *)
|
| 70 |
|
|
|
| 71 |
|
|
(* return the type of a global schema element *)
|
| 72 |
|
|
val get_schema_type: string * string -> Types.descr
|
| 73 |
abate |
542 |
|
| 74 |
|
|
|
| 75 |
|
|
|
| 76 |
|
|
(* Operators *)
|
| 77 |
|
|
|
| 78 |
abate |
691 |
type type_fun = Types.t -> bool -> Types.t
|
| 79 |
|
|
val mk_unary_op: (string -> t -> int) ref
|
| 80 |
|
|
val typ_unary_op: (int -> loc -> type_fun -> type_fun) ref
|
| 81 |
abate |
542 |
|
| 82 |
abate |
691 |
val mk_binary_op: (string -> t -> int) ref
|
| 83 |
|
|
val typ_binary_op: (int -> loc -> type_fun -> type_fun -> type_fun) ref
|
| 84 |
|
|
|