@@ -14,7 +14,7 @@ pub use self::DelimToken::*;
14
14
pub use self :: Lit :: * ;
15
15
pub use self :: Token :: * ;
16
16
17
- use ast:: { self , BinOpKind } ;
17
+ use ast:: { self } ;
18
18
use ptr:: P ;
19
19
use util:: interner:: Interner ;
20
20
use tokenstream;
@@ -258,31 +258,6 @@ impl Token {
258
258
self . is_path_segment_keyword ( ) || self . is_ident ( ) && !self . is_any_keyword ( )
259
259
}
260
260
261
- /// Maps a token to its corresponding binary operator.
262
- pub fn to_binop ( & self ) -> Option < BinOpKind > {
263
- match * self {
264
- BinOp ( Star ) => Some ( BinOpKind :: Mul ) ,
265
- BinOp ( Slash ) => Some ( BinOpKind :: Div ) ,
266
- BinOp ( Percent ) => Some ( BinOpKind :: Rem ) ,
267
- BinOp ( Plus ) => Some ( BinOpKind :: Add ) ,
268
- BinOp ( Minus ) => Some ( BinOpKind :: Sub ) ,
269
- BinOp ( Shl ) => Some ( BinOpKind :: Shl ) ,
270
- BinOp ( Shr ) => Some ( BinOpKind :: Shr ) ,
271
- BinOp ( And ) => Some ( BinOpKind :: BitAnd ) ,
272
- BinOp ( Caret ) => Some ( BinOpKind :: BitXor ) ,
273
- BinOp ( Or ) => Some ( BinOpKind :: BitOr ) ,
274
- Lt => Some ( BinOpKind :: Lt ) ,
275
- Le => Some ( BinOpKind :: Le ) ,
276
- Ge => Some ( BinOpKind :: Ge ) ,
277
- Gt => Some ( BinOpKind :: Gt ) ,
278
- EqEq => Some ( BinOpKind :: Eq ) ,
279
- Ne => Some ( BinOpKind :: Ne ) ,
280
- AndAnd => Some ( BinOpKind :: And ) ,
281
- OrOr => Some ( BinOpKind :: Or ) ,
282
- _ => None ,
283
- }
284
- }
285
-
286
261
/// Returns `true` if the token is a given keyword, `kw`.
287
262
pub fn is_keyword ( & self , kw : keywords:: Keyword ) -> bool {
288
263
match * self {
0 commit comments