[breaking-change] don't glob export ast::BinOp_
This commit is contained in:
parent
f875f4c4c2
commit
05e25de4f0
12 changed files with 164 additions and 164 deletions
|
@ -15,7 +15,7 @@ pub use self::IdentStyle::*;
|
|||
pub use self::Lit::*;
|
||||
pub use self::Token::*;
|
||||
|
||||
use ast;
|
||||
use ast::{self, BinOpKind};
|
||||
use ext::mtwt;
|
||||
use ptr::P;
|
||||
use util::interner::{RcStr, StrInterner};
|
||||
|
@ -264,26 +264,26 @@ impl Token {
|
|||
}
|
||||
|
||||
/// Maps a token to its corresponding binary operator.
|
||||
pub fn to_binop(&self) -> Option<ast::BinOp_> {
|
||||
pub fn to_binop(&self) -> Option<BinOpKind> {
|
||||
match *self {
|
||||
BinOp(Star) => Some(ast::BiMul),
|
||||
BinOp(Slash) => Some(ast::BiDiv),
|
||||
BinOp(Percent) => Some(ast::BiRem),
|
||||
BinOp(Plus) => Some(ast::BiAdd),
|
||||
BinOp(Minus) => Some(ast::BiSub),
|
||||
BinOp(Shl) => Some(ast::BiShl),
|
||||
BinOp(Shr) => Some(ast::BiShr),
|
||||
BinOp(And) => Some(ast::BiBitAnd),
|
||||
BinOp(Caret) => Some(ast::BiBitXor),
|
||||
BinOp(Or) => Some(ast::BiBitOr),
|
||||
Lt => Some(ast::BiLt),
|
||||
Le => Some(ast::BiLe),
|
||||
Ge => Some(ast::BiGe),
|
||||
Gt => Some(ast::BiGt),
|
||||
EqEq => Some(ast::BiEq),
|
||||
Ne => Some(ast::BiNe),
|
||||
AndAnd => Some(ast::BiAnd),
|
||||
OrOr => Some(ast::BiOr),
|
||||
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,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue