pub fn to_binop(&self) -> Option<BinOpKind> {
        match *self {
            BinOp(Star)     => Some(BinOpKind::Mul),
            BinOp(Slash)    => Some(BinOpKind::Div),
            BinOp(Percent)  => Some(BinOpKind::Rem),
            BinOp(Plus)     => Some(BinOpKind::Add),
            BinOp(Minus)    => Some(BinOpKind::Sub),
            BinOp(Shl)      => Some(BinOpKind::Shl),
            BinOp(Shr)      => Some(BinOpKind::Shr),
            BinOp(And)      => Some(BinOpKind::BitAnd),
            BinOp(Caret)    => Some(BinOpKind::BitXor),
            BinOp(Or)       => Some(BinOpKind::BitOr),
            Lt              => Some(BinOpKind::Lt),
            Le              => Some(BinOpKind::Le),
            Ge              => Some(BinOpKind::Ge),
            Gt              => Some(BinOpKind::Gt),
            EqEq            => Some(BinOpKind::Eq),
            Ne              => Some(BinOpKind::Ne),
            AndAnd          => Some(BinOpKind::And),
            OrOr            => Some(BinOpKind::Or),
            _               => None,
        }
    }
/// Maps a token to its corresponding binary operator.
Maps a token to its corresponding binary operator.
Maps a token to its corresponding binary operator .
pub fn to_binop(&self) -> Option<BinOpKind> {
        match *self {
            BinOp(Star)     => Some(BinOpKind::Mul),
            BinOp(Slash)    => Some(BinOpKind::Div),
            BinOp(Percent)  => Some(BinOpKind::Rem),
            BinOp(Plus)     => Some(BinOpKind::Add),
            BinOp(Minus)    => Some(BinOpKind::Sub),
            BinOp(Shl)      => Some(BinOpKind::Shl),
            BinOp(Shr)      => Some(BinOpKind::Shr),
            BinOp(And)      => Some(BinOpKind::BitAnd),
            BinOp(Caret)    => Some(BinOpKind::BitXor),
            BinOp(Or)       => Some(BinOpKind::BitOr),
            Lt              => Some(BinOpKind::Lt),
            Le              => Some(BinOpKind::Le),
            Ge              => Some(BinOpKind::Ge),
            Gt              => Some(BinOpKind::Gt),
            EqEq            => Some(BinOpKind::Eq),
            Ne              => Some(BinOpKind::Ne),
            AndAnd          => Some(BinOpKind::And),
            OrOr            => Some(BinOpKind::Or),
            _               => None,
        }
    }
pub fn to_binop ( & self ) -> Option < BinOpKind > { match * self { BinOp ( Star ) => Some ( BinOpKind :: Mul ) , BinOp ( Slash ) => Some ( BinOpKind :: Div ) , BinOp ( Percent ) => Some ( BinOpKind :: Rem ) , BinOp ( Plus ) => Some ( BinOpKind :: Add ) , BinOp ( Minus ) => Some ( BinOpKind :: Sub ) , BinOp ( Shl ) => Some ( BinOpKind :: Shl ) , BinOp ( Shr ) => Some ( BinOpKind :: Shr ) , BinOp ( And ) => Some ( BinOpKind :: BitAnd ) , BinOp ( Caret ) => Some ( BinOpKind :: BitXor ) , BinOp ( Or ) => Some ( BinOpKind :: BitOr ) , Lt => Some ( BinOpKind :: Lt ) , Le => Some ( BinOpKind :: Le ) , Ge => Some ( BinOpKind :: Ge ) , Gt => Some ( BinOpKind :: Gt ) , EqEq => Some ( BinOpKind :: Eq ) , Ne => Some ( BinOpKind :: Ne ) , AndAnd => Some ( BinOpKind :: And ) , OrOr => Some ( BinOpKind :: Or ) , _ => None , } }
Maps a token to its corresponding binary operator.
Maps a token to its corresponding binary operator .
&self
&self