add repeats to ast

This commit is contained in:
Aleksey Kladov 2019-01-31 10:33:11 +03:00
parent 3bd4560d6e
commit 82cf0185c3

View file

@ -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,
}