Implement array value

Adds ArrayValue docs, and tests for diagnostics.
This commit is contained in:
Diego Augusto S. C 2023-11-03 19:10:12 -03:00 committed by Sonny Piers
parent f1cf70b6eb
commit 14be727777
12 changed files with 115 additions and 4 deletions

View file

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