mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Format using black
This commit is contained in:
parent
6a36d92380
commit
8fee46ec68
40 changed files with 975 additions and 610 deletions
|
@ -24,8 +24,12 @@ from .common import *
|
|||
|
||||
class GtkDirective(AstNode):
|
||||
grammar = Statement(
|
||||
Match("using").err("File must start with a \"using Gtk\" directive (e.g. `using Gtk 4.0;`)"),
|
||||
Match("Gtk").err("File must start with a \"using Gtk\" directive (e.g. `using Gtk 4.0;`)"),
|
||||
Match("using").err(
|
||||
'File must start with a "using Gtk" directive (e.g. `using Gtk 4.0;`)'
|
||||
),
|
||||
Match("Gtk").err(
|
||||
'File must start with a "using Gtk" directive (e.g. `using Gtk 4.0;`)'
|
||||
),
|
||||
UseNumberText("version").expected("a version number for GTK"),
|
||||
)
|
||||
|
||||
|
@ -35,7 +39,9 @@ class GtkDirective(AstNode):
|
|||
if version not in ["4.0"]:
|
||||
err = CompileError("Only GTK 4 is supported")
|
||||
if version and version.startswith("4"):
|
||||
err.hint("Expected the GIR version, not an exact version number. Use 'using Gtk 4.0;'.")
|
||||
err.hint(
|
||||
"Expected the GIR version, not an exact version number. Use 'using Gtk 4.0;'."
|
||||
)
|
||||
else:
|
||||
err.hint("Expected 'using Gtk 4.0;'")
|
||||
raise err
|
||||
|
@ -51,7 +57,6 @@ class GtkDirective(AstNode):
|
|||
hints=e.hints,
|
||||
)
|
||||
|
||||
|
||||
@property
|
||||
def gir_namespace(self):
|
||||
# validate the GTK version first to make sure the more specific error
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue