diff options
Diffstat (limited to 'crates/ra_hir/src/macros/tt.rs')
-rw-r--r-- | crates/ra_hir/src/macros/tt.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ra_hir/src/macros/tt.rs b/crates/ra_hir/src/macros/tt.rs index 11b1089d3..02ff422b5 100644 --- a/crates/ra_hir/src/macros/tt.rs +++ b/crates/ra_hir/src/macros/tt.rs | |||
@@ -1,11 +1,13 @@ | |||
1 | use ra_syntax::SmolStr; | 1 | use ra_syntax::SmolStr; |
2 | 2 | ||
3 | #[derive(Debug)] | ||
3 | pub(crate) enum TokenTree { | 4 | pub(crate) enum TokenTree { |
4 | Leaf(Leaf), | 5 | Leaf(Leaf), |
5 | Subtree(Subtree), | 6 | Subtree(Subtree), |
6 | } | 7 | } |
7 | impl_froms!(TokenTree: Leaf, Subtree); | 8 | impl_froms!(TokenTree: Leaf, Subtree); |
8 | 9 | ||
10 | #[derive(Debug)] | ||
9 | pub(crate) enum Leaf { | 11 | pub(crate) enum Leaf { |
10 | Literal(Literal), | 12 | Literal(Literal), |
11 | Punct(Punct), | 13 | Punct(Punct), |
@@ -13,11 +15,13 @@ pub(crate) enum Leaf { | |||
13 | } | 15 | } |
14 | impl_froms!(Leaf: Literal, Punct, Ident); | 16 | impl_froms!(Leaf: Literal, Punct, Ident); |
15 | 17 | ||
18 | #[derive(Debug)] | ||
16 | pub(crate) struct Subtree { | 19 | pub(crate) struct Subtree { |
17 | pub(crate) delimiter: Delimiter, | 20 | pub(crate) delimiter: Delimiter, |
18 | pub(crate) token_trees: Vec<TokenTree>, | 21 | pub(crate) token_trees: Vec<TokenTree>, |
19 | } | 22 | } |
20 | 23 | ||
24 | #[derive(Debug)] | ||
21 | pub(crate) enum Delimiter { | 25 | pub(crate) enum Delimiter { |
22 | Parenthesis, | 26 | Parenthesis, |
23 | Brace, | 27 | Brace, |
@@ -25,14 +29,17 @@ pub(crate) enum Delimiter { | |||
25 | None, | 29 | None, |
26 | } | 30 | } |
27 | 31 | ||
32 | #[derive(Debug)] | ||
28 | pub(crate) struct Literal { | 33 | pub(crate) struct Literal { |
29 | pub(crate) text: SmolStr, | 34 | pub(crate) text: SmolStr, |
30 | } | 35 | } |
31 | 36 | ||
37 | #[derive(Debug)] | ||
32 | pub(crate) struct Punct { | 38 | pub(crate) struct Punct { |
33 | pub(crate) char: char, | 39 | pub(crate) char: char, |
34 | } | 40 | } |
35 | 41 | ||
42 | #[derive(Debug)] | ||
36 | pub(crate) struct Ident { | 43 | pub(crate) struct Ident { |
37 | pub(crate) text: SmolStr, | 44 | pub(crate) text: SmolStr, |
38 | } | 45 | } |