about summary refs log tree commit diff
path: root/compiler/rustc_ast/src
diff options
context:
space:
mode:
authorDeep Majumder <deep.majumder2019@gmail.com>2022-12-14 19:10:03 +0530
committerDeep Majumder <deep.majumder2019@gmail.com>2022-12-14 19:12:30 +0530
commitc4d0c911615a7b4efecca47abab294c7c1b788ce (patch)
treeb5df828aed87ffe039e7e4113c926848ff76eb8d /compiler/rustc_ast/src
parent71ec1457ee9868a838e4521a3510cdd416c0c295 (diff)
downloadrust-c4d0c911615a7b4efecca47abab294c7c1b788ce.tar.gz
rust-c4d0c911615a7b4efecca47abab294c7c1b788ce.zip
Allow .. to be parsed as let initializer
.. and ..= are valid expressions, however when used in a let statement
it is not parsed.
Diffstat (limited to 'compiler/rustc_ast/src')
-rw-r--r--compiler/rustc_ast/src/token.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_ast/src/token.rs b/compiler/rustc_ast/src/token.rs
index 7b8c0d79a17..5247007fdce 100644
--- a/compiler/rustc_ast/src/token.rs
+++ b/compiler/rustc_ast/src/token.rs
@@ -379,6 +379,10 @@ impl Token {
         }
     }
 
+    pub fn is_range_seperator(&self) -> bool {
+        [DotDot, DotDotDot, DotDotEq].contains(&self.kind)
+    }
+
     pub fn is_op(&self) -> bool {
         match self.kind {
             Eq | Lt | Le | EqEq | Ne | Ge | Gt | AndAnd | OrOr | Not | Tilde | BinOp(_)