mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Add GObject Introspection integration
- Parse .gir files - Validate class, property, and signal names
This commit is contained in:
parent
2ad2f1c54a
commit
e553e5db29
10 changed files with 734 additions and 58 deletions
|
@ -18,9 +18,10 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
|
||||
import argparse, sys
|
||||
import argparse, json, os, sys
|
||||
|
||||
from .errors import PrintableError, report_compile_error
|
||||
from .errors import PrintableError, report_compile_error, MultipleErrors
|
||||
from .lsp import LanguageServer
|
||||
from .pipeline import Pipeline
|
||||
from . import parser, tokenizer
|
||||
|
||||
|
@ -43,6 +44,8 @@ class BlueprintApp:
|
|||
try:
|
||||
opts = self.parser.parse_args()
|
||||
opts.func(opts)
|
||||
except SystemExit as e:
|
||||
raise e
|
||||
except:
|
||||
report_compile_error()
|
||||
|
||||
|
@ -60,7 +63,12 @@ class BlueprintApp:
|
|||
try:
|
||||
tokens = tokenizer.tokenize(data)
|
||||
ast = parser.parse(tokens)
|
||||
|
||||
if len(ast.errors):
|
||||
raise MultipleErrors(ast.errors)
|
||||
|
||||
xml = ast.generate()
|
||||
|
||||
if opts.output == "-":
|
||||
print(xml)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue