summaryrefslogtreecommitdiff
path: root/compiler/Errors.ml
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/Errors.ml')
-rw-r--r--compiler/Errors.ml6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/Errors.ml b/compiler/Errors.ml
index 30887593..7dfe659a 100644
--- a/compiler/Errors.ml
+++ b/compiler/Errors.ml
@@ -20,6 +20,12 @@ let format_error_message_with_file_line (file : string) (line : int)
"In file " ^ file ^ ", line " ^ string_of_int line ^ ":\n"
^ format_error_message meta msg
+let error_list_to_string (error_list : (Meta.meta option * string) list) :
+ string =
+ List.fold_left
+ (fun errors (meta, msg) -> errors ^ "\n" ^ format_error_message meta msg)
+ "" error_list
+
exception CFailure of (Meta.meta option * string)
let error_list : (Meta.meta option * string) list ref = ref []