mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
parser: Simplify parser construction
- Replace several different parse nodes with Match, which matches the exact text of a token but not the token type - Allow arrays to be used in place of Sequence
This commit is contained in:
parent
ad6a2cf538
commit
8d587b62a0
11 changed files with 182 additions and 211 deletions
|
@ -53,7 +53,7 @@ layout_prop = Group(
|
|||
LayoutProperty,
|
||||
Statement(
|
||||
UseIdent("name"),
|
||||
Op(":"),
|
||||
":",
|
||||
value.expected("a value"),
|
||||
)
|
||||
)
|
||||
|
@ -61,9 +61,9 @@ layout_prop = Group(
|
|||
layout = Group(
|
||||
Layout,
|
||||
Sequence(
|
||||
Keyword("layout", True),
|
||||
OpenBlock(),
|
||||
Until(layout_prop, CloseBlock()),
|
||||
Keyword("layout"),
|
||||
"{",
|
||||
Until(layout_prop, "}"),
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue