Add StringValue

Makes the grammar more specific in a few places that take only a string
literal or translated string.
This commit is contained in:
James Westman 2023-04-11 21:26:37 -05:00
parent 5bfed72674
commit ac2a7d9282
8 changed files with 66 additions and 42 deletions

View file

@ -20,17 +20,16 @@
from .attributes import BaseTypedAttribute
from .gobject_object import ObjectContent, validate_parent_type
from .values import Value, Translated
from .values import StringValue
from .common import *
from .contexts import ValueTypeCtx
class Item(AstNode):
grammar = Value
grammar = StringValue
@context(ValueTypeCtx)
def value_type(self) -> ValueTypeCtx:
return ValueTypeCtx(StringType())
@property
def child(self) -> StringValue:
return self.children[StringValue][0]
class Strings(AstNode):