aboutsummaryrefslogtreecommitdiff
path: root/crates/mbe
diff options
context:
space:
mode:
Diffstat (limited to 'crates/mbe')
-rw-r--r--crates/mbe/src/mbe_expander/matcher.rs2
-rw-r--r--crates/mbe/src/subtree_source.rs8
-rw-r--r--crates/mbe/src/syntax_bridge.rs4
3 files changed, 9 insertions, 5 deletions
diff --git a/crates/mbe/src/mbe_expander/matcher.rs b/crates/mbe/src/mbe_expander/matcher.rs
index 93ee77908..7aeef7be5 100644
--- a/crates/mbe/src/mbe_expander/matcher.rs
+++ b/crates/mbe/src/mbe_expander/matcher.rs
@@ -295,7 +295,7 @@ impl<'a> TtIter<'a> {
295 295
296 impl<'a> TreeSink for OffsetTokenSink<'a> { 296 impl<'a> TreeSink for OffsetTokenSink<'a> {
297 fn token(&mut self, kind: SyntaxKind, mut n_tokens: u8) { 297 fn token(&mut self, kind: SyntaxKind, mut n_tokens: u8) {
298 if kind == SyntaxKind::LIFETIME { 298 if kind == SyntaxKind::LIFETIME_IDENT {
299 n_tokens = 2; 299 n_tokens = 2;
300 } 300 }
301 for _ in 0..n_tokens { 301 for _ in 0..n_tokens {
diff --git a/crates/mbe/src/subtree_source.rs b/crates/mbe/src/subtree_source.rs
index ccc56c479..d10d4b70e 100644
--- a/crates/mbe/src/subtree_source.rs
+++ b/crates/mbe/src/subtree_source.rs
@@ -84,7 +84,11 @@ impl<'a> SubtreeTokenSource<'a> {
84 } 84 }
85 85
86 if let Some((curr, text)) = is_lifetime(cursor) { 86 if let Some((curr, text)) = is_lifetime(cursor) {
87 cached.push(Some(TtToken { kind: LIFETIME, is_joint_to_next: false, text })); 87 cached.push(Some(TtToken {
88 kind: LIFETIME_IDENT,
89 is_joint_to_next: false,
90 text,
91 }));
88 self.cached_cursor.set(curr); 92 self.cached_cursor.set(curr);
89 continue; 93 continue;
90 } 94 }
@@ -172,7 +176,7 @@ fn convert_ident(ident: &tt::Ident) -> TtToken {
172 let kind = match ident.text.as_ref() { 176 let kind = match ident.text.as_ref() {
173 "true" => T![true], 177 "true" => T![true],
174 "false" => T![false], 178 "false" => T![false],
175 i if i.starts_with('\'') => LIFETIME, 179 i if i.starts_with('\'') => LIFETIME_IDENT,
176 _ => SyntaxKind::from_keyword(ident.text.as_str()).unwrap_or(IDENT), 180 _ => SyntaxKind::from_keyword(ident.text.as_str()).unwrap_or(IDENT),
177 }; 181 };
178 182
diff --git a/crates/mbe/src/syntax_bridge.rs b/crates/mbe/src/syntax_bridge.rs
index d987b2500..265c0d63d 100644
--- a/crates/mbe/src/syntax_bridge.rs
+++ b/crates/mbe/src/syntax_bridge.rs
@@ -380,7 +380,7 @@ trait TokenConvertor {
380 IDENT => make_leaf!(Ident), 380 IDENT => make_leaf!(Ident),
381 k if k.is_keyword() => make_leaf!(Ident), 381 k if k.is_keyword() => make_leaf!(Ident),
382 k if k.is_literal() => make_leaf!(Literal), 382 k if k.is_literal() => make_leaf!(Literal),
383 LIFETIME => { 383 LIFETIME_IDENT => {
384 let char_unit = TextSize::of('\''); 384 let char_unit = TextSize::of('\'');
385 let r = TextRange::at(range.start(), char_unit); 385 let r = TextRange::at(range.start(), char_unit);
386 let apostrophe = tt::Leaf::from(tt::Punct { 386 let apostrophe = tt::Leaf::from(tt::Punct {
@@ -620,7 +620,7 @@ impl<'a> TreeSink for TtTreeSink<'a> {
620 self.cursor = self.cursor.bump_subtree(); 620 self.cursor = self.cursor.bump_subtree();
621 return; 621 return;
622 } 622 }
623 if kind == LIFETIME { 623 if kind == LIFETIME_IDENT {
624 n_tokens = 2; 624 n_tokens = 2;
625 } 625 }
626 626