From 7a9ffa730740c18d23918add84c40bdf77f17dc0 Mon Sep 17 00:00:00 2001 From: Crazycolorz5 Date: Fri, 25 May 2018 17:09:32 -0400 Subject: Added is_like_plus to token, and used that in place of equality comparison to Plus token. --- src/libsyntax/parse/token.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/libsyntax/parse/token.rs') diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 9770fbca8f8..18665b99e21 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -224,6 +224,13 @@ impl Token { _ => false, } } + + pub fn is_like_plus(&self) -> bool { + match *self { + BinOp(Plus) | BinOpEq(Plus) => true, + _ => false, + } + } /// Returns `true` if the token can appear at the start of an expression. pub fn can_begin_expr(&self) -> bool { -- cgit 1.4.1-3-g733a5