mbe: treat _ as ident

This commit is contained in:
Laurențiu Nicola
2020-12-18 17:47:48 +02:00
parent f4929fa9cc
commit 75a26f64ff
4 changed files with 18 additions and 3 deletions

View File

@@ -313,7 +313,7 @@ trait TokenConvertor {
return;
}
result.push(if k.is_punct() {
result.push(if k.is_punct() && k != UNDERSCORE {
assert_eq!(range.len(), TextSize::of('.'));
let delim = match k {
T!['('] => Some((tt::DelimiterKind::Parenthesis, T![')'])),
@@ -378,6 +378,7 @@ trait TokenConvertor {
let leaf: tt::Leaf = match k {
T![true] | T![false] => make_leaf!(Ident),
IDENT => make_leaf!(Ident),
UNDERSCORE => make_leaf!(Ident),
k if k.is_keyword() => make_leaf!(Ident),
k if k.is_literal() => make_leaf!(Literal),
LIFETIME_IDENT => {