Make bare underscore token an Ident rather than Punct in proc-macro

This commit is contained in:
Kevin Mehall
2021-03-20 12:18:57 -06:00
parent 5cc8ad0c4a
commit 0a0e22235b
6 changed files with 24 additions and 12 deletions

View File

@@ -150,6 +150,7 @@ fn convert_ident(ident: &tt::Ident) -> TtToken {
let kind = match ident.text.as_ref() {
"true" => T![true],
"false" => T![false],
"_" => UNDERSCORE,
i if i.starts_with('\'') => LIFETIME_IDENT,
_ => SyntaxKind::from_keyword(ident.text.as_str()).unwrap_or(IDENT),
};