X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=compiler%2Fsrc%2Flib%2Ftiger%2Ftiger_error.ml;h=ce506d9e606744c5b40dc24bf0a1a743d27e427c;hb=5da420a8c9d88111ef4ccabd6b0a0c65cddb73af;hp=20a1f7d1d3a0fdfb2b5f75e796a5aab9e94a9135;hpb=c16dd441582b7c7c09cdb3e706f4767a5b266177;p=tiger.ml.git diff --git a/compiler/src/lib/tiger/tiger_error.ml b/compiler/src/lib/tiger/tiger_error.ml index 20a1f7d..ce506d9 100644 --- a/compiler/src/lib/tiger/tiger_error.ml +++ b/compiler/src/lib/tiger/tiger_error.ml @@ -110,3 +110,19 @@ let to_string = (Abs.op_show oper) (Typ.to_string right) (Pos.to_string pos) + +let is_unknown_id t = + match t with + | Unknown_id _ -> + true + | Invalid_syntax _ + | Unknown_type _ + | Id_not_a_function _ + | Wrong_type_of_expression_in_var_dec _ + | Wrong_type_used_as_record _ + | Wrong_type_of_field_value _ + | Wrong_type_of_arg _ + | Wrong_number_of_args _ + | Invalid_operand_type _ + | Different_operand_types _ -> + false