aboutsummaryrefslogtreecommitdiff
path: root/crates/mbe/src/syntax_bridge.rs
diff options
context:
space:
mode:
authorLaurenČ›iu Nicola <[email protected]>2020-12-18 15:47:48 +0000
committerLaurenČ›iu Nicola <[email protected]>2020-12-20 06:06:17 +0000
commit75a26f64ff8aa4fcacd849b2b3cde8f688baa789 (patch)
tree8ecd068bb0d8764833f1b9f018fa36726761089a /crates/mbe/src/syntax_bridge.rs
parentf4929fa9ccd0eda65c2b77fef163c31e33bfb89a (diff)
mbe: treat _ as ident
Diffstat (limited to 'crates/mbe/src/syntax_bridge.rs')
-rw-r--r--crates/mbe/src/syntax_bridge.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/mbe/src/syntax_bridge.rs b/crates/mbe/src/syntax_bridge.rs
index 265c0d63d..2bec7fd49 100644
--- a/crates/mbe/src/syntax_bridge.rs
+++ b/crates/mbe/src/syntax_bridge.rs
@@ -313,7 +313,7 @@ trait TokenConvertor {
313 return; 313 return;
314 } 314 }
315 315
316 result.push(if k.is_punct() { 316 result.push(if k.is_punct() && k != UNDERSCORE {
317 assert_eq!(range.len(), TextSize::of('.')); 317 assert_eq!(range.len(), TextSize::of('.'));
318 let delim = match k { 318 let delim = match k {
319 T!['('] => Some((tt::DelimiterKind::Parenthesis, T![')'])), 319 T!['('] => Some((tt::DelimiterKind::Parenthesis, T![')'])),
@@ -378,6 +378,7 @@ trait TokenConvertor {
378 let leaf: tt::Leaf = match k { 378 let leaf: tt::Leaf = match k {
379 T![true] | T![false] => make_leaf!(Ident), 379 T![true] | T![false] => make_leaf!(Ident),
380 IDENT => make_leaf!(Ident), 380 IDENT => make_leaf!(Ident),
381 UNDERSCORE => make_leaf!(Ident),
381 k if k.is_keyword() => make_leaf!(Ident), 382 k if k.is_keyword() => make_leaf!(Ident),
382 k if k.is_literal() => make_leaf!(Literal), 383 k if k.is_literal() => make_leaf!(Literal),
383 LIFETIME_IDENT => { 384 LIFETIME_IDENT => {