diff options
author | Aleksey Kladov <[email protected]> | 2019-01-31 07:33:11 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-31 20:23:30 +0000 |
commit | 82cf0185c36faf81dbdf7e64843bdfc5b4df1b21 (patch) | |
tree | 32a8fed662f5de9086fe2c12c44581e394a2cb0d | |
parent | 3bd4560d6eb6404f05c2c99a5755b86e9e896eb9 (diff) |
add repeats to ast
-rw-r--r-- | crates/ra_hir/src/macros/mbe.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/ra_hir/src/macros/mbe.rs b/crates/ra_hir/src/macros/mbe.rs index 2d7965b62..1408ed511 100644 --- a/crates/ra_hir/src/macros/mbe.rs +++ b/crates/ra_hir/src/macros/mbe.rs | |||
@@ -14,6 +14,7 @@ struct Rule { | |||
14 | enum TokenTree { | 14 | enum TokenTree { |
15 | Leaf(Leaf), | 15 | Leaf(Leaf), |
16 | Subtree(Subtree), | 16 | Subtree(Subtree), |
17 | Repeat(Repeat), | ||
17 | } | 18 | } |
18 | 19 | ||
19 | enum Leaf { | 20 | enum Leaf { |
@@ -35,6 +36,17 @@ enum Delimiter { | |||
35 | None, | 36 | None, |
36 | } | 37 | } |
37 | 38 | ||
39 | struct Repeat { | ||
40 | subtree: Subtree, | ||
41 | kind: RepeatKind, | ||
42 | } | ||
43 | |||
44 | enum RepeatKind { | ||
45 | ZeroOrMore, | ||
46 | OneOrMore, | ||
47 | ZeroOrOne, | ||
48 | } | ||
49 | |||
38 | struct Literal { | 50 | struct Literal { |
39 | text: SmolStr, | 51 | text: SmolStr, |
40 | } | 52 | } |