about summary refs log tree commit diff
path: root/src/libsyntax/parse/token.rs
diff options
context:
space:
mode:
authorCrazycolorz5 <Crazycolorz5@gmail.com>2018-05-25 17:09:32 -0400
committerCrazycolorz5 <Crazycolorz5@gmail.com>2018-06-04 22:25:00 -0400
commit7a9ffa730740c18d23918add84c40bdf77f17dc0 (patch)
treed70d24f98b998bfa42861fd08de062b48db0881c /src/libsyntax/parse/token.rs
parent682033c4e47cf0cca5b4b96b07123da8807254f6 (diff)
downloadrust-7a9ffa730740c18d23918add84c40bdf77f17dc0.tar.gz
rust-7a9ffa730740c18d23918add84c40bdf77f17dc0.zip
Added is_like_plus to token, and used that in place of equality comparison to Plus token.
Diffstat (limited to 'src/libsyntax/parse/token.rs')
-rw-r--r--src/libsyntax/parse/token.rs7
1 files changed, 7 insertions, 0 deletions
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 {