preliminary variant syntax

This commit is contained in:
jgcodes2020 2024-12-14 10:33:46 -05:00
parent 778a979714
commit f894301571
4 changed files with 58 additions and 3 deletions

View file

@ -22,12 +22,12 @@ from .binding import Binding
from .common import *
from .contexts import ValueTypeCtx
from .gtkbuilder_template import Template
from .values import ArrayValue, ObjectValue, Value
from .values import ArrayValue, ObjectValue, Value, VariantValue
class Property(AstNode):
grammar = Statement(
UseIdent("name"), ":", AnyOf(Binding, ObjectValue, Value, ArrayValue)
UseIdent("name"), ":", AnyOf(Binding, VariantValue, ObjectValue, Value, ArrayValue)
)
@property
@ -35,7 +35,7 @@ class Property(AstNode):
return self.tokens["name"]
@property
def value(self) -> T.Union[Binding, ObjectValue, Value, ArrayValue]:
def value(self) -> T.Union[Binding, VariantValue, ObjectValue, Value, ArrayValue]:
return self.children[0]
@property