mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-05 16:09:07 -04:00
preliminary variant syntax
This commit is contained in:
parent
778a979714
commit
f894301571
4 changed files with 58 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue