Check scope of break statements
[tiger.ml.git] / compiler / src / lib / tiger / tiger_error.mli
1 module Abs = Tiger_absyn
2 module Pos = Tiger_position
3 module Sym = Tiger_symbol
4 module Typ = Tiger_env_type
5
6 type t =
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 }
13 | Break_outside_loop of Pos.t
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}
17 | Id_is_a_function of {id : Sym.t; pos : Pos.t}
18 | Id_not_a_function of {id : Sym.t; pos : Pos.t}
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}
21 | Exp_not_an_array of {ty : Typ.t; pos : Pos.t}
22 | Wrong_type of
23 { expected : Typ.t
24 ; given : Typ.t
25 ; pos : Pos.t
26 }
27 | Wrong_type_of_expression_in_var_dec of
28 { var_id : Sym.t
29 ; expected : Typ.t
30 ; given : Typ.t
31 ; pos : Pos.t
32 }
33 | Wrong_type_used_as_record of
34 { ty_id : Sym.t
35 ; ty : Typ.t
36 ; pos : Pos.t
37 }
38 | Wrong_type_used_as_array of
39 { ty_id : Sym.t
40 ; ty : Typ.t
41 ; pos : Pos.t
42 }
43 | Wrong_type_of_field_value of
44 { field_id : Sym.t
45 ; expected : Typ.t
46 ; given : Typ.t
47 ; pos : Pos.t
48 }
49 | Wrong_type_of_arg of
50 { func : Sym.t
51 ; expected : Typ.t
52 ; given : Typ.t
53 ; pos : Pos.t
54 }
55 | Wrong_number_of_args of
56 { func : Sym.t
57 ; expected : int
58 ; given : int
59 ; pos : Pos.t
60 }
61 | Invalid_operand_type of
62 { oper : Abs.oper
63 ; valid : string list
64 ; given : Typ.t
65 ; pos : Pos.t
66 }
67 | Different_operand_types of
68 { oper : Abs.oper
69 ; left : Typ.t
70 ; right : Typ.t
71 ; pos : Pos.t
72 }
73
74 exception T of t
75
76 val raise : t -> 'a
77
78 val to_string : t -> string
79
80 val is_unknown_id : t -> bool
81 val is_unknown_type : t -> bool
82 val is_wrong_type : t -> bool
83 val is_wrong_number_of_args : t -> bool
84 val is_invalid_syntax : t -> bool
85 val is_not_a_record : t -> bool
86 val is_not_an_array : t -> bool
87 val is_no_such_field_in_record : t -> bool
88 val is_cycle_in_type_dec : t -> bool
89 val is_break_outside_loop : t -> bool
This page took 0.054226 seconds and 4 git commands to generate.