@@ -14,7 +14,7 @@ pub use self::DelimToken::*;
1414pub use self :: Lit :: * ;
1515pub use self :: Token :: * ;
1616
17- use ast:: { self , BinOpKind } ;
17+ use ast:: { self } ;
1818use ptr:: P ;
1919use util:: interner:: Interner ;
2020use tokenstream;
@@ -258,31 +258,6 @@ impl Token {
258258 self . is_path_segment_keyword ( ) || self . is_ident ( ) && !self . is_any_keyword ( )
259259 }
260260
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-
286261 /// Returns `true` if the token is a given keyword, `kw`.
287262 pub fn is_keyword ( & self , kw : keywords:: Keyword ) -> bool {
288263 match * self {
0 commit comments