aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_tt
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_tt')
-rw-r--r--crates/ra_tt/src/lib.rs10
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
19use smol_str::SmolStr; 19use smol_str::SmolStr;
20 20
21#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
22pub struct TokenId(pub u32);
23
24impl TokenId {
25 pub const fn unspecified() -> TokenId {
26 TokenId(!0)
27 }
28}
29
21#[derive(Debug, Clone)] 30#[derive(Debug, Clone)]
22pub enum TokenTree { 31pub enum TokenTree {
23 Leaf(Leaf), 32 Leaf(Leaf),
@@ -67,6 +76,7 @@ pub enum Spacing {
67#[derive(Debug, Clone)] 76#[derive(Debug, Clone)]
68pub struct Ident { 77pub struct Ident {
69 pub text: SmolStr, 78 pub text: SmolStr,
79 pub id: TokenId,
70} 80}
71 81
72impl fmt::Display for TokenTree { 82impl fmt::Display for TokenTree {