Simplify error & warning handling

This commit is contained in:
James Westman 2022-12-25 17:10:21 -06:00
parent 122b049ce9
commit b6ee649458
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
8 changed files with 38 additions and 21 deletions

View file

@ -24,7 +24,7 @@ import os
from . import decompiler, tokenizer, parser
from .outputs.xml import XmlOutput
from .errors import MultipleErrors, PrintableError
from .errors import MultipleErrors, PrintableError, CompilerBugError
from .utils import Colors
@ -57,8 +57,8 @@ def decompile_file(in_file, out_file) -> T.Union[str, CouldNotPort]:
if errors:
raise errors
if len(ast.errors):
raise MultipleErrors(ast.errors)
if not ast:
raise CompilerBugError()
output = XmlOutput()
output.emit(ast)