From e9bbac75812ef556585f14b72239133619cf1748 Mon Sep 17 00:00:00 2001 From: Son Ho Date: Wed, 3 Apr 2024 17:49:00 +0200 Subject: Update the initial configuration --- compiler/Main.ml | 3 --- 1 file changed, 3 deletions(-) (limited to 'compiler/Main.ml') diff --git a/compiler/Main.ml b/compiler/Main.ml index 64d8ae2b..db200f37 100644 --- a/compiler/Main.ml +++ b/compiler/Main.ml @@ -120,9 +120,6 @@ let () = Arg.Set use_nested_tuple_projectors, " Use nested projectors for tuples (e.g., (0, 1).snd.fst instead of \ (0, 1).1)." ); - ( "-ext-name-pats", - Arg.Set extract_external_name_patterns, - " Generate name patterns for the external definitions we find." ); ] in -- cgit v1.2.3 From 16ea3ca854a77703487afa8732f247bc26cba695 Mon Sep 17 00:00:00 2001 From: Escherichia Date: Thu, 4 Apr 2024 13:23:50 +0200 Subject: Now prints all errors in the error_list --- compiler/Main.ml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'compiler/Main.ml') diff --git a/compiler/Main.ml b/compiler/Main.ml index db200f37..9e72a21b 100644 --- a/compiler/Main.ml +++ b/compiler/Main.ml @@ -274,12 +274,14 @@ let () = (* Translate the functions *) Aeneas.Translate.translate_crate filename dest_dir m - with Errors.CFailure (meta, msg) -> + with Errors.CFailure (_, _) -> (* In theory it shouldn't happen, but there may be uncaught errors - note that we let the [Failure] exceptions go through (they are send if we use the option [-abort-on-error] *) - log#serror (Errors.format_error_message meta msg); - exit 1); + if not (List.is_empty !Errors.error_list) then ( + let errors = Errors.error_list_to_string !Errors.error_list in + log#serror errors; + exit 1)); (* Print total elapsed time *) log#linfo -- cgit v1.2.3 From 1f3ce79023d902d0145da38e878d991a6ba29236 Mon Sep 17 00:00:00 2001 From: Son Ho Date: Thu, 4 Apr 2024 15:47:54 +0200 Subject: Update the way errors are reported --- compiler/Main.ml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'compiler/Main.ml') diff --git a/compiler/Main.ml b/compiler/Main.ml index 9e72a21b..416f3a07 100644 --- a/compiler/Main.ml +++ b/compiler/Main.ml @@ -278,10 +278,13 @@ let () = (* In theory it shouldn't happen, but there may be uncaught errors - note that we let the [Failure] exceptions go through (they are send if we use the option [-abort-on-error] *) - if not (List.is_empty !Errors.error_list) then ( - let errors = Errors.error_list_to_string !Errors.error_list in - log#serror errors; - exit 1)); + ()); + + if !Errors.error_list <> [] then ( + List.iter + (fun (meta, msg) -> log#serror (Errors.format_error_message meta msg)) + !Errors.error_list; + exit 1); (* Print total elapsed time *) log#linfo -- cgit v1.2.3 From 581d5c0cb8e618382fa41e5a42175560283ff0a1 Mon Sep 17 00:00:00 2001 From: Son Ho Date: Sun, 7 Apr 2024 14:27:14 +0200 Subject: Cleanup a bit and improve the error messages --- compiler/Main.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compiler/Main.ml') 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 *) -- cgit v1.2.3