Remove PropertyBinding rule, just use Binding

This commit is contained in:
James Westman 2023-05-22 21:26:07 -05:00
parent abc4e5de65
commit 0a4b5d07a1
16 changed files with 100 additions and 179 deletions

View file

@ -22,21 +22,18 @@ from .binding import Binding
from .common import *
from .contexts import ValueTypeCtx
from .gtkbuilder_template import Template
from .property_binding import PropertyBinding
from .values import ObjectValue, Value
class Property(AstNode):
grammar = Statement(
UseIdent("name"), ":", AnyOf(PropertyBinding, Binding, ObjectValue, Value)
)
grammar = Statement(UseIdent("name"), ":", AnyOf(Binding, ObjectValue, Value))
@property
def name(self) -> str:
return self.tokens["name"]
@property
def value(self) -> T.Union[PropertyBinding, Binding, ObjectValue, Value]:
def value(self) -> T.Union[Binding, ObjectValue, Value]:
return self.children[0]
@property
@ -51,7 +48,7 @@ class Property(AstNode):
@validate()
def binding_valid(self):
if (
(isinstance(self.value, PropertyBinding) or isinstance(self.value, Binding))
isinstance(self.value, Binding)
and self.gir_property is not None
and self.gir_property.construct_only
):