@@ -251,17 +251,6 @@ pub enum TokenKind {
251251 /// similarly to symbols in string literal tokens.
252252 DocComment ( CommentKind , ast:: AttrStyle , Symbol ) ,
253253
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-
265254 Eof ,
266255}
267256
@@ -331,7 +320,7 @@ impl Token {
331320
332321 /// Some token that will be thrown away later.
333322 pub fn dummy ( ) -> Self {
334- Token :: new ( TokenKind :: Whitespace , DUMMY_SP )
323+ Token :: new ( TokenKind :: Question , DUMMY_SP )
335324 }
336325
337326 /// Recovers a `Token` from an `Ident`. This creates a raw identifier if necessary.
@@ -360,7 +349,7 @@ impl Token {
360349 pub fn is_op ( & self ) -> bool {
361350 match self . kind {
362351 OpenDelim ( ..) | CloseDelim ( ..) | Literal ( ..) | DocComment ( ..) | Ident ( ..)
363- | Lifetime ( ..) | Interpolated ( ..) | Whitespace | Comment | Shebang ( .. ) | Eof => false ,
352+ | Lifetime ( ..) | Interpolated ( ..) | Eof => false ,
364353 _ => true ,
365354 }
366355 }
@@ -676,8 +665,7 @@ impl Token {
676665 Le | EqEq | Ne | Ge | AndAnd | OrOr | Tilde | BinOpEq ( ..) | At | DotDotDot
677666 | DotDotEq | Comma | Semi | ModSep | RArrow | LArrow | FatArrow | Pound | Dollar
678667 | Question | OpenDelim ( ..) | CloseDelim ( ..) | Literal ( ..) | Ident ( ..)
679- | Lifetime ( ..) | Interpolated ( ..) | DocComment ( ..) | Whitespace | Comment
680- | Shebang ( ..) | Unknown ( ..) | Eof => return None ,
668+ | Lifetime ( ..) | Interpolated ( ..) | DocComment ( ..) | Eof => return None ,
681669 } ;
682670
683671 Some ( Token :: new ( kind, self . span . to ( joint. span ) ) )
0 commit comments