mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-05 16:09:07 -04:00
Merge branch 'variant-literal' into 'main'
Draft: Syntax for variants See merge request jwestman/blueprint-compiler!224
This commit is contained in:
commit
6f87c07320
8 changed files with 337 additions and 14 deletions
|
@ -22,12 +22,14 @@ 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 +37,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