X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=compiler%2Fsrc%2Flib%2Ftiger%2Ftiger_error.mli;h=84d4317eeaea1758430fe682d6cece5a3a5c07b3;hb=b9b456cc1bb9aff5e9e6972492d446a468feddcf;hp=4009ed51d9f79e8c9f4baa76041086731ec6f5e5;hpb=c16dd441582b7c7c09cdb3e706f4767a5b266177;p=tiger.ml.git diff --git a/compiler/src/lib/tiger/tiger_error.mli b/compiler/src/lib/tiger/tiger_error.mli index 4009ed5..84d4317 100644 --- a/compiler/src/lib/tiger/tiger_error.mli +++ b/compiler/src/lib/tiger/tiger_error.mli @@ -1,48 +1,53 @@ +module Abs = Tiger_absyn +module Pos = Tiger_position +module Sym = Tiger_symbol +module Typ = Tiger_env_type + type t = - | Invalid_syntax of Tiger_position.t - | Unknown_id of {id : Tiger_symbol.t; pos : Tiger_position.t} - | Unknown_type of {ty_id : Tiger_symbol.t; pos : Tiger_position.t} - | Id_not_a_function of {id : Tiger_symbol.t; pos : Tiger_position.t} + | Invalid_syntax of Pos.t + | Unknown_id of {id : Sym.t; pos : Pos.t} + | Unknown_type of {ty_id : Sym.t; pos : Pos.t} + | Id_not_a_function of {id : Sym.t; pos : Pos.t} | Wrong_type_of_expression_in_var_dec of - { var_id : Tiger_symbol.t - ; expected : Tiger_env_type.t - ; given : Tiger_env_type.t - ; pos : Tiger_position.t + { var_id : Sym.t + ; expected : Typ.t + ; given : Typ.t + ; pos : Pos.t } | Wrong_type_used_as_record of - { ty_id : Tiger_symbol.t - ; ty : Tiger_env_type.t - ; pos : Tiger_position.t + { ty_id : Sym.t + ; ty : Typ.t + ; pos : Pos.t } | Wrong_type_of_field_value of - { field_id : Tiger_symbol.t - ; expected : Tiger_env_type.t - ; given : Tiger_env_type.t - ; pos : Tiger_position.t + { field_id : Sym.t + ; expected : Typ.t + ; given : Typ.t + ; pos : Pos.t } | Wrong_type_of_arg of - { func : Tiger_symbol.t - ; expected : Tiger_env_type.t - ; given : Tiger_env_type.t - ; pos : Tiger_position.t + { func : Sym.t + ; expected : Typ.t + ; given : Typ.t + ; pos : Pos.t } | Wrong_number_of_args of - { func : Tiger_symbol.t + { func : Sym.t ; expected : int ; given : int - ; pos : Tiger_position.t + ; pos : Pos.t } | Invalid_operand_type of - { oper : Tiger_absyn.oper + { oper : Abs.oper ; valid : string list - ; given : Tiger_env_type.t - ; pos : Tiger_position.t + ; given : Typ.t + ; pos : Pos.t } | Different_operand_types of - { oper : Tiger_absyn.oper - ; left : Tiger_env_type.t - ; right : Tiger_env_type.t - ; pos : Tiger_position.t + { oper : Abs.oper + ; left : Typ.t + ; right : Typ.t + ; pos : Pos.t } exception T of t @@ -50,3 +55,5 @@ exception T of t val raise : t -> 'a val to_string : t -> string + +val is_unknown_id : t -> bool