add repeats to ast
This commit is contained in:
parent
3bd4560d6e
commit
82cf0185c3
1 changed files with 12 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ struct Rule {
|
|||
enum TokenTree {
|
||||
Leaf(Leaf),
|
||||
Subtree(Subtree),
|
||||
Repeat(Repeat),
|
||||
}
|
||||
|
||||
enum Leaf {
|
||||
|
|
@ -35,6 +36,17 @@ enum Delimiter {
|
|||
None,
|
||||
}
|
||||
|
||||
struct Repeat {
|
||||
subtree: Subtree,
|
||||
kind: RepeatKind,
|
||||
}
|
||||
|
||||
enum RepeatKind {
|
||||
ZeroOrMore,
|
||||
OneOrMore,
|
||||
ZeroOrOne,
|
||||
}
|
||||
|
||||
struct Literal {
|
||||
text: SmolStr,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue