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:
James Westman 2022-01-04 16:59:19 -06:00
parent ad6a2cf538
commit 8d587b62a0
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
11 changed files with 182 additions and 211 deletions

View file

@ -155,18 +155,18 @@ a11y_prop = Group(
A11yProperty,
Statement(
UseIdent("name"),
Op(":"),
":",
value.expected("a value"),
)
)
a11y = Group(
A11y,
Sequence(
Keyword("accessibility", True),
OpenBlock(),
Until(a11y_prop, CloseBlock()),
)
[
Keyword("accessibility"),
"{",
Until(a11y_prop, "}"),
]
)