mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Separate output into its own module
This commit is contained in:
parent
8cf793023d
commit
a24f16109f
33 changed files with 407 additions and 291 deletions
|
@ -23,6 +23,7 @@ import difflib
|
|||
import os
|
||||
|
||||
from . import decompiler, tokenizer, parser
|
||||
from .outputs.xml import XmlOutput
|
||||
from .errors import MultipleErrors, PrintableError
|
||||
from .utils import Colors
|
||||
|
||||
|
@ -57,7 +58,8 @@ def decompile_file(in_file, out_file) -> T.Union[str, CouldNotPort]:
|
|||
if len(ast.errors):
|
||||
raise MultipleErrors(ast.errors)
|
||||
|
||||
ast.generate()
|
||||
output = XmlOutput()
|
||||
output.emit(ast)
|
||||
except PrintableError as e:
|
||||
e.pretty_print(out_file, decompiled)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue