aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe/src
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2019-04-21 05:32:39 +0100
committerEdwin Cheng <[email protected]>2019-04-21 22:04:36 +0100
commitda05bbcfb1da752ef6d07eb1f4d9ac6ba187d573 (patch)
tree5d634a97b87bc8dd4d494afaffded5bb1de89f96 /crates/ra_mbe/src
parentee94edc722c9649bd16bb754959ad349593045e2 (diff)
Fix lifetime in tt to syntax node conversion
Diffstat (limited to 'crates/ra_mbe/src')
-rw-r--r--crates/ra_mbe/src/subtree_source.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/ra_mbe/src/subtree_source.rs b/crates/ra_mbe/src/subtree_source.rs
index 16a053b49..6d4d8fa13 100644
--- a/crates/ra_mbe/src/subtree_source.rs
+++ b/crates/ra_mbe/src/subtree_source.rs
@@ -429,7 +429,12 @@ fn convert_literal(l: &tt::Literal) -> TtToken {
429} 429}
430 430
431fn convert_ident(ident: &tt::Ident) -> TtToken { 431fn convert_ident(ident: &tt::Ident) -> TtToken {
432 let kind = SyntaxKind::from_keyword(ident.text.as_str()).unwrap_or(IDENT); 432 let kind = if let Some('\'') = ident.text.chars().next() {
433 LIFETIME
434 } else {
435 SyntaxKind::from_keyword(ident.text.as_str()).unwrap_or(IDENT)
436 };
437
433 TtToken { kind, is_joint_to_next: false, text: ident.text.clone(), n_tokens: 1 } 438 TtToken { kind, is_joint_to_next: false, text: ident.text.clone(), n_tokens: 1 }
434} 439}
435 440