@@ -299,6 +299,10 @@ pub enum TokenKind {
299
299
/// It's recommended to use `Token::(ident,uninterpolate,uninterpolated_span)` to
300
300
/// treat regular and interpolated identifiers in the same way.
301
301
Ident ( Symbol , /* is_raw */ bool ) ,
302
+
303
+ /// A `k#ident` keyword
304
+ Keyword ( Symbol ) ,
305
+
302
306
/// Lifetime identifier token.
303
307
/// Do not forget about `NtLifetime` when you want to match on lifetime identifiers.
304
308
/// It's recommended to use `Token::(lifetime,uninterpolate,uninterpolated_span)` to
@@ -438,7 +442,7 @@ impl Token {
438
442
| ModSep | RArrow | LArrow | FatArrow | Pound | Dollar | Question | SingleQuote => true ,
439
443
440
444
OpenDelim ( ..) | CloseDelim ( ..) | Literal ( ..) | DocComment ( ..) | Ident ( ..)
441
- | Lifetime ( ..) | Interpolated ( ..) | Eof => false ,
445
+ | Keyword ( .. ) | Lifetime ( ..) | Interpolated ( ..) | Eof => false ,
442
446
}
443
447
}
444
448
@@ -812,7 +816,7 @@ impl Token {
812
816
813
817
Le | EqEq | Ne | Ge | AndAnd | OrOr | Tilde | BinOpEq ( ..) | At | DotDotDot
814
818
| DotDotEq | Comma | Semi | ModSep | RArrow | LArrow | FatArrow | Pound | Dollar
815
- | Question | OpenDelim ( ..) | CloseDelim ( ..) | Literal ( ..) | Ident ( ..)
819
+ | Question | OpenDelim ( ..) | CloseDelim ( ..) | Literal ( ..) | Ident ( ..) | Keyword ( .. )
816
820
| Lifetime ( ..) | Interpolated ( ..) | DocComment ( ..) | Eof => return None ,
817
821
} ;
818
822
0 commit comments