mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-06 21:45:29 +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:
committed by
Andrew Kaster
parent
3aec6952a2
commit
0806ccaeec
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user