mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Simplify error & warning handling
This commit is contained in:
parent
122b049ce9
commit
b6ee649458
8 changed files with 38 additions and 21 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue