diff options
author | Aleksey Kladov <[email protected]> | 2019-01-30 20:58:52 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-31 20:23:30 +0000 |
commit | c09c6fc97c1d553dd348383eb98fc7a4788030cb (patch) | |
tree | 2a89c345b5bbc25943b971a3752988e52a8edef9 /crates/ra_hir/src/macros | |
parent | a4342a7feeaca642a64ad908432a17b31f081e01 (diff) |
start tt convertions boilerplate
Diffstat (limited to 'crates/ra_hir/src/macros')
-rw-r--r-- | crates/ra_hir/src/macros/tt.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/crates/ra_hir/src/macros/tt.rs b/crates/ra_hir/src/macros/tt.rs index 817cb262e..11b1089d3 100644 --- a/crates/ra_hir/src/macros/tt.rs +++ b/crates/ra_hir/src/macros/tt.rs | |||
@@ -4,16 +4,18 @@ pub(crate) enum TokenTree { | |||
4 | Leaf(Leaf), | 4 | Leaf(Leaf), |
5 | Subtree(Subtree), | 5 | Subtree(Subtree), |
6 | } | 6 | } |
7 | impl_froms!(TokenTree: Leaf, Subtree); | ||
7 | 8 | ||
8 | pub(crate) enum Leaf { | 9 | pub(crate) enum Leaf { |
9 | Literal(Literal), | 10 | Literal(Literal), |
10 | Punct(Punct), | 11 | Punct(Punct), |
11 | Ident(Ident), | 12 | Ident(Ident), |
12 | } | 13 | } |
14 | impl_froms!(Leaf: Literal, Punct, Ident); | ||
13 | 15 | ||
14 | pub(crate) struct Subtree { | 16 | pub(crate) struct Subtree { |
15 | delimiter: Delimiter, | 17 | pub(crate) delimiter: Delimiter, |
16 | token_trees: Vec<TokenTree>, | 18 | pub(crate) token_trees: Vec<TokenTree>, |
17 | } | 19 | } |
18 | 20 | ||
19 | pub(crate) enum Delimiter { | 21 | pub(crate) enum Delimiter { |
@@ -24,13 +26,13 @@ pub(crate) enum Delimiter { | |||
24 | } | 26 | } |
25 | 27 | ||
26 | pub(crate) struct Literal { | 28 | pub(crate) struct Literal { |
27 | text: SmolStr, | 29 | pub(crate) text: SmolStr, |
28 | } | 30 | } |
29 | 31 | ||
30 | pub(crate) struct Punct { | 32 | pub(crate) struct Punct { |
31 | char: char, | 33 | pub(crate) char: char, |
32 | } | 34 | } |
33 | 35 | ||
34 | pub(crate) struct Ident { | 36 | pub(crate) struct Ident { |
35 | text: SmolStr, | 37 | pub(crate) text: SmolStr, |
36 | } | 38 | } |