diff options
Diffstat (limited to 'crates/ra_tt')
-rw-r--r-- | crates/ra_tt/src/lib.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/ra_tt/src/lib.rs b/crates/ra_tt/src/lib.rs index df31f72f3..e0a4cdb8b 100644 --- a/crates/ra_tt/src/lib.rs +++ b/crates/ra_tt/src/lib.rs | |||
@@ -18,6 +18,15 @@ use std::fmt; | |||
18 | 18 | ||
19 | use smol_str::SmolStr; | 19 | use smol_str::SmolStr; |
20 | 20 | ||
21 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | ||
22 | pub struct TokenId(pub u32); | ||
23 | |||
24 | impl TokenId { | ||
25 | pub const fn unspecified() -> TokenId { | ||
26 | TokenId(!0) | ||
27 | } | ||
28 | } | ||
29 | |||
21 | #[derive(Debug, Clone)] | 30 | #[derive(Debug, Clone)] |
22 | pub enum TokenTree { | 31 | pub enum TokenTree { |
23 | Leaf(Leaf), | 32 | Leaf(Leaf), |
@@ -67,6 +76,7 @@ pub enum Spacing { | |||
67 | #[derive(Debug, Clone)] | 76 | #[derive(Debug, Clone)] |
68 | pub struct Ident { | 77 | pub struct Ident { |
69 | pub text: SmolStr, | 78 | pub text: SmolStr, |
79 | pub id: TokenId, | ||
70 | } | 80 | } |
71 | 81 | ||
72 | impl fmt::Display for TokenTree { | 82 | impl fmt::Display for TokenTree { |