diff options
author | Florian Diebold <[email protected]> | 2020-03-13 12:03:31 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2020-03-16 17:38:19 +0000 |
commit | b973158aeb337041d4e1434cf5d8c609a0b02bef (patch) | |
tree | e3da1bb7a3c2d89623382865edc7ef64c039496d /crates/ra_tt/src | |
parent | d3773ec1522681de117d354f0c82e753c68c6d0b (diff) |
Make MBE expansion more resilient (WIP)
Diffstat (limited to 'crates/ra_tt/src')
-rw-r--r-- | crates/ra_tt/src/lib.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ra_tt/src/lib.rs b/crates/ra_tt/src/lib.rs index 10f424aae..1e2fb8b91 100644 --- a/crates/ra_tt/src/lib.rs +++ b/crates/ra_tt/src/lib.rs | |||
@@ -40,6 +40,12 @@ pub enum TokenTree { | |||
40 | } | 40 | } |
41 | impl_froms!(TokenTree: Leaf, Subtree); | 41 | impl_froms!(TokenTree: Leaf, Subtree); |
42 | 42 | ||
43 | impl TokenTree { | ||
44 | pub fn empty() -> Self { | ||
45 | TokenTree::Subtree(Subtree::default()) | ||
46 | } | ||
47 | } | ||
48 | |||
43 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 49 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
44 | pub enum Leaf { | 50 | pub enum Leaf { |
45 | Literal(Literal), | 51 | Literal(Literal), |