From da05bbcfb1da752ef6d07eb1f4d9ac6ba187d573 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sun, 21 Apr 2019 12:32:39 +0800 Subject: Fix lifetime in tt to syntax node conversion --- crates/ra_mbe/src/subtree_source.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 { } fn convert_ident(ident: &tt::Ident) -> TtToken { - let kind = SyntaxKind::from_keyword(ident.text.as_str()).unwrap_or(IDENT); + let kind = if let Some('\'') = ident.text.chars().next() { + LIFETIME + } else { + SyntaxKind::from_keyword(ident.text.as_str()).unwrap_or(IDENT) + }; + TtToken { kind, is_joint_to_next: false, text: ident.text.clone(), n_tokens: 1 } } -- cgit v1.2.3