mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-22 11:02:53 +00:00
JSSpecCompiler: Start converting crashes to error messages
I got fed up with looking at error messages that tell me "VERIFICATION FAILED: !is_error()". So this commit introduces DiagnosticEngine class whose purpose is to accumulate and print more user-friendly errors.
This commit is contained in:
parent
3aec6952a2
commit
0806ccaeec
Notes:
sideshowbarker
2024-07-16 22:22:13 +09:00
Author: https://github.com/DanShaders
Commit: 0806ccaeec
Pull-request: https://github.com/SerenityOS/serenity/pull/22794
Reviewed-by: https://github.com/ADKaster ✅
8 changed files with 262 additions and 4 deletions
|
@ -136,6 +136,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
for (auto const& step : pipeline.pipeline()) {
|
||||
step.step->run(&translation_unit);
|
||||
|
||||
if (translation_unit.diag().has_fatal_errors()) {
|
||||
translation_unit.diag().print_diagnostics();
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (step.dump_ast) {
|
||||
outln(stderr, "===== AST after {} =====", step.step->name());
|
||||
for (auto const& function : translation_unit.functions_to_compile()) {
|
||||
|
@ -152,5 +157,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
}
|
||||
}
|
||||
|
||||
translation_unit.diag().print_diagnostics();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue