aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand/src/quote.rs
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2019-12-12 13:47:54 +0000
committerEdwin Cheng <[email protected]>2019-12-18 03:20:22 +0000
commitaceb9d7fb0809ccf364514d9177342edea144c59 (patch)
tree138ee608477eb951072eeac6ace239647e3d01a3 /crates/ra_hir_expand/src/quote.rs
parent46ca40ccfced6945e05a25979a2703ad967d2fe0 (diff)
Add token ids for all tt::Leaf
Diffstat (limited to 'crates/ra_hir_expand/src/quote.rs')
-rw-r--r--crates/ra_hir_expand/src/quote.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/crates/ra_hir_expand/src/quote.rs b/crates/ra_hir_expand/src/quote.rs
index aa8a5f23f..bce38cc67 100644
--- a/crates/ra_hir_expand/src/quote.rs
+++ b/crates/ra_hir_expand/src/quote.rs
@@ -29,6 +29,7 @@ macro_rules! __quote {
29 tt::Leaf::Punct(tt::Punct { 29 tt::Leaf::Punct(tt::Punct {
30 char: $first, 30 char: $first,
31 spacing: tt::Spacing::Alone, 31 spacing: tt::Spacing::Alone,
32 id: tt::TokenId::unspecified(),
32 }).into() 33 }).into()
33 ] 34 ]
34 } 35 }
@@ -40,10 +41,12 @@ macro_rules! __quote {
40 tt::Leaf::Punct(tt::Punct { 41 tt::Leaf::Punct(tt::Punct {
41 char: $first, 42 char: $first,
42 spacing: tt::Spacing::Joint, 43 spacing: tt::Spacing::Joint,
44 id: tt::TokenId::unspecified(),
43 }).into(), 45 }).into(),
44 tt::Leaf::Punct(tt::Punct { 46 tt::Leaf::Punct(tt::Punct {
45 char: $sec, 47 char: $sec,
46 spacing: tt::Spacing::Alone, 48 spacing: tt::Spacing::Alone,
49 id: tt::TokenId::unspecified(),
47 }).into() 50 }).into()
48 ] 51 ]
49 } 52 }
@@ -179,15 +182,15 @@ macro_rules! impl_to_to_tokentrees {
179} 182}
180 183
181impl_to_to_tokentrees! { 184impl_to_to_tokentrees! {
182 u32 => self { tt::Literal{text: self.to_string().into()} }; 185 u32 => self { tt::Literal{text: self.to_string().into(), id: tt::TokenId::unspecified()} };
183 usize => self { tt::Literal{text: self.to_string().into()}}; 186 usize => self { tt::Literal{text: self.to_string().into(), id: tt::TokenId::unspecified()}};
184 i32 => self { tt::Literal{text: self.to_string().into()}}; 187 i32 => self { tt::Literal{text: self.to_string().into(), id: tt::TokenId::unspecified()}};
185 tt::Leaf => self { self }; 188 tt::Leaf => self { self };
186 tt::Literal => self { self }; 189 tt::Literal => self { self };
187 tt::Ident => self { self }; 190 tt::Ident => self { self };
188 tt::Punct => self { self }; 191 tt::Punct => self { self };
189 &str => self { tt::Literal{text: format!("{:?}", self.escape_default().to_string()).into()}}; 192 &str => self { tt::Literal{text: format!("{:?}", self.escape_default().to_string()).into(), id: tt::TokenId::unspecified()}};
190 String => self { tt::Literal{text: format!("{:?}", self.escape_default().to_string()).into()}} 193 String => self { tt::Literal{text: format!("{:?}", self.escape_default().to_string()).into(), id: tt::TokenId::unspecified()}}
191} 194}
192 195
193#[cfg(test)] 196#[cfg(test)]