@@ -251,17 +251,6 @@ pub enum TokenKind {
251
251
/// similarly to symbols in string literal tokens.
252
252
DocComment ( CommentKind , ast:: AttrStyle , Symbol ) ,
253
253
254
- // Junk. These carry no data because we don't really care about the data
255
- // they *would* carry, and don't really want to allocate a new ident for
256
- // them. Instead, users could extract that from the associated span.
257
- /// Whitespace.
258
- Whitespace ,
259
- /// A comment.
260
- Comment ,
261
- Shebang ( Symbol ) ,
262
- /// A completely invalid token which should be skipped.
263
- Unknown ( Symbol ) ,
264
-
265
254
Eof ,
266
255
}
267
256
@@ -331,7 +320,7 @@ impl Token {
331
320
332
321
/// Some token that will be thrown away later.
333
322
pub fn dummy ( ) -> Self {
334
- Token :: new ( TokenKind :: Whitespace , DUMMY_SP )
323
+ Token :: new ( TokenKind :: Question , DUMMY_SP )
335
324
}
336
325
337
326
/// Recovers a `Token` from an `Ident`. This creates a raw identifier if necessary.
@@ -360,7 +349,7 @@ impl Token {
360
349
pub fn is_op ( & self ) -> bool {
361
350
match self . kind {
362
351
OpenDelim ( ..) | CloseDelim ( ..) | Literal ( ..) | DocComment ( ..) | Ident ( ..)
363
- | Lifetime ( ..) | Interpolated ( ..) | Whitespace | Comment | Shebang ( .. ) | Eof => false ,
352
+ | Lifetime ( ..) | Interpolated ( ..) | Eof => false ,
364
353
_ => true ,
365
354
}
366
355
}
@@ -676,8 +665,7 @@ impl Token {
676
665
Le | EqEq | Ne | Ge | AndAnd | OrOr | Tilde | BinOpEq ( ..) | At | DotDotDot
677
666
| DotDotEq | Comma | Semi | ModSep | RArrow | LArrow | FatArrow | Pound | Dollar
678
667
| Question | OpenDelim ( ..) | CloseDelim ( ..) | Literal ( ..) | Ident ( ..)
679
- | Lifetime ( ..) | Interpolated ( ..) | DocComment ( ..) | Whitespace | Comment
680
- | Shebang ( ..) | Unknown ( ..) | Eof => return None ,
668
+ | Lifetime ( ..) | Interpolated ( ..) | DocComment ( ..) | Eof => return None ,
681
669
} ;
682
670
683
671
Some ( Token :: new ( kind, self . span . to ( joint. span ) ) )
0 commit comments