1
Fork 0
This commit is contained in:
York Xiang 2015-04-18 09:18:46 +08:00
parent 9d439b4177
commit 0ad48e41c1
13 changed files with 507 additions and 2 deletions

View file

@ -173,6 +173,14 @@ pub enum Token {
}
impl Token {
/// Returns `true` if the token starts with '>'.
pub fn is_like_gt(&self) -> bool {
match *self {
BinOp(Shr) | BinOpEq(Shr) | Gt | Ge => true,
_ => false,
}
}
/// Returns `true` if the token can appear at the start of an expression.
pub fn can_begin_expr(&self) -> bool {
match *self {