summaryrefslogtreecommitdiff
path: root/compiler/Main.ml
diff options
context:
space:
mode:
authorSon Ho2024-04-07 14:27:14 +0200
committerSon Ho2024-04-07 14:27:14 +0200
commit581d5c0cb8e618382fa41e5a42175560283ff0a1 (patch)
tree1dd0066fe740febc6a36182e73248b4d616cb57e /compiler/Main.ml
parent3a470ec6661a494631a12594989126804aeb044d (diff)
Cleanup a bit and improve the error messages
Diffstat (limited to 'compiler/Main.ml')
-rw-r--r--compiler/Main.ml4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/Main.ml b/compiler/Main.ml
index 416f3a07..6161f2f2 100644
--- a/compiler/Main.ml
+++ b/compiler/Main.ml
@@ -283,7 +283,9 @@ let () =
if !Errors.error_list <> [] then (
List.iter
(fun (meta, msg) -> log#serror (Errors.format_error_message meta msg))
- !Errors.error_list;
+ (* Reverse the list of error messages so that we print them from the
+ earliest to the latest. *)
+ (List.rev !Errors.error_list);
exit 1);
(* Print total elapsed time *)