mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-06-22 23:19:25 -04:00
Minor code cleanup
This commit is contained in:
parent
4d62df0068
commit
5b50090b65
3 changed files with 11 additions and 23 deletions
|
@ -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, ","),
|
||||
"]",
|
||||
]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue