Add option iter
[tiger.ml.git] / compiler / src / lib / tiger / tiger_error.mli
CommitLineData
b9b456cc
SK
1module Abs = Tiger_absyn
2module Pos = Tiger_position
3module Sym = Tiger_symbol
4module Typ = Tiger_env_type
5
c16dd441 6type t =
e6e82c08
SK
7 | Cycle_in_type_decs of
8 { from_id : Sym.t
9 ; from_pos : Pos.t
10 ; to_id : Sym.t
11 ; to_pos : Pos.t
12 }
35dccbd3 13 | Break_outside_loop of Pos.t
b9b456cc
SK
14 | Invalid_syntax of Pos.t
15 | Unknown_id of {id : Sym.t; pos : Pos.t}
16 | Unknown_type of {ty_id : Sym.t; pos : Pos.t}
523e2b06 17 | Id_is_a_function of {id : Sym.t; pos : Pos.t}
b9b456cc 18 | Id_not_a_function of {id : Sym.t; pos : Pos.t}
523e2b06
SK
19 | No_such_field_in_record of {field : Sym.t; record : Typ.t; pos : Pos.t}
20 | Exp_not_a_record of {ty : Typ.t; pos : Pos.t}
161a300d 21 | Exp_not_an_array of {ty : Typ.t; pos : Pos.t}
523e2b06
SK
22 | Wrong_type of
23 { expected : Typ.t
24 ; given : Typ.t
25 ; pos : Pos.t
26 }
c16dd441 27 | Wrong_type_of_expression_in_var_dec of
b9b456cc
SK
28 { var_id : Sym.t
29 ; expected : Typ.t
30 ; given : Typ.t
31 ; pos : Pos.t
c16dd441
SK
32 }
33 | Wrong_type_used_as_record of
b9b456cc
SK
34 { ty_id : Sym.t
35 ; ty : Typ.t
36 ; pos : Pos.t
c16dd441 37 }
4c550cd5
SK
38 | Wrong_type_used_as_array of
39 { ty_id : Sym.t
40 ; ty : Typ.t
41 ; pos : Pos.t
42 }
c16dd441 43 | Wrong_type_of_field_value of
b9b456cc
SK
44 { field_id : Sym.t
45 ; expected : Typ.t
46 ; given : Typ.t
47 ; pos : Pos.t
c16dd441
SK
48 }
49 | Wrong_type_of_arg of
b9b456cc
SK
50 { func : Sym.t
51 ; expected : Typ.t
52 ; given : Typ.t
53 ; pos : Pos.t
c16dd441
SK
54 }
55 | Wrong_number_of_args of
b9b456cc 56 { func : Sym.t
c16dd441
SK
57 ; expected : int
58 ; given : int
b9b456cc 59 ; pos : Pos.t
c16dd441
SK
60 }
61 | Invalid_operand_type of
b9b456cc 62 { oper : Abs.oper
c16dd441 63 ; valid : string list
b9b456cc
SK
64 ; given : Typ.t
65 ; pos : Pos.t
c16dd441
SK
66 }
67 | Different_operand_types of
b9b456cc
SK
68 { oper : Abs.oper
69 ; left : Typ.t
70 ; right : Typ.t
71 ; pos : Pos.t
c16dd441 72 }
7c14a966 73
c16dd441
SK
74exception T of t
75
76val raise : t -> 'a
77
78val to_string : t -> string
5da420a8 79
155073e2
SK
80val is_unknown_id : t -> bool
81val is_unknown_type : t -> bool
82val is_wrong_type : t -> bool
54e838f4 83val is_wrong_number_of_args : t -> bool
789ef466 84val is_invalid_syntax : t -> bool
1d155dc1
SK
85val is_not_a_record : t -> bool
86val is_not_an_array : t -> bool
87val is_no_such_field_in_record : t -> bool
e6e82c08 88val is_cycle_in_type_dec : t -> bool
35dccbd3 89val is_break_outside_loop : t -> bool
This page took 0.044345 seconds and 4 git commands to generate.