mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Add errors for duplicate properties and blocks
This commit is contained in:
parent
f18c8b7a2d
commit
824476bda1
12 changed files with 122 additions and 0 deletions
|
@ -139,6 +139,13 @@ class A11yProperty(BaseTypedAttribute):
|
|||
did_you_mean=(self.tokens["name"], types.keys()),
|
||||
)
|
||||
|
||||
@validate("name")
|
||||
def unique_in_parent(self):
|
||||
self.validate_unique_in_parent(
|
||||
f"Duplicate accessibility attribute '{self.tokens['name']}'",
|
||||
check=lambda child: child.tokens["name"] == self.tokens["name"],
|
||||
)
|
||||
|
||||
@docs("name")
|
||||
def prop_docs(self):
|
||||
if self.tokens["name"] in get_types(self.root.gir):
|
||||
|
@ -156,6 +163,9 @@ class A11y(AstNode):
|
|||
def container_is_widget(self):
|
||||
validate_parent_type(self, "Gtk", "Widget", "accessibility properties")
|
||||
|
||||
@validate("accessibility")
|
||||
def unique_in_parent(self):
|
||||
self.validate_unique_in_parent("Duplicate accessibility block")
|
||||
|
||||
def emit_xml(self, xml: XmlEmitter):
|
||||
xml.start_tag("accessibility")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue