mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-05 16:09:07 -04:00
Improved validation
This commit is contained in:
parent
981c2e3b7d
commit
f1e1811e1f
13 changed files with 51 additions and 13 deletions
|
@ -28,6 +28,10 @@ from ..xml_emitter import XmlEmitter
|
|||
|
||||
|
||||
class Widgets(AstNode):
|
||||
@validate("widgets")
|
||||
def container_is_size_group(self):
|
||||
self.validate_parent_type("Gtk", "SizeGroup", "size group properties")
|
||||
|
||||
def emit_xml(self, xml: XmlEmitter):
|
||||
xml.start_tag("widgets")
|
||||
for child in self.children:
|
||||
|
@ -57,7 +61,7 @@ class Widget(AstNode):
|
|||
widgets = Group(
|
||||
Widgets,
|
||||
Statement(
|
||||
Keyword("widgets"),
|
||||
Keyword("widgets", True),
|
||||
OpenBracket(),
|
||||
Delimited(
|
||||
Group(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue