Minor code cleanup

This commit is contained in:
James Westman 2023-05-02 09:28:42 -05:00
parent 4d62df0068
commit 5b50090b65
3 changed files with 11 additions and 23 deletions

View file

@ -25,6 +25,11 @@ from .values import StringValue
class Item(AstNode):
grammar = [
Optional([UseIdent("name"), ":"]),
StringValue,
]
@property
def name(self) -> str:
return self.tokens["name"]
@ -34,25 +39,11 @@ class Item(AstNode):
return self.children[StringValue][0]
item = Group(
Item,
[
Optional(
[
UseIdent("name"),
":",
]
),
StringValue,
],
)
class ExtComboBoxItems(AstNode):
grammar = [
Keyword("items"),
"[",
Delimited(item, ","),
Delimited(Item, ","),
"]",
]