mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Remove PropertyBinding rule, just use Binding
This commit is contained in:
parent
abc4e5de65
commit
0a4b5d07a1
16 changed files with 100 additions and 179 deletions
|
@ -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
|
||||
):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue