about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-10-01 03:17:24 +0000
committerbors <bors@rust-lang.org>2014-10-01 03:17:24 +0000
commit2f15dcd4d3865f9cc466637027eb02d5607b2bb7 (patch)
tree1a4d8526c45a53753c612bcbb6d283928c927cbc /src/libsyntax/parse/parser.rs
parent57a05cf49b3149427e3fe190c07f8343a29ad86c (diff)
parent416144b8279fbffceacea6d0fd90e0fd1f8ce53d (diff)
downloadrust-2f15dcd4d3865f9cc466637027eb02d5607b2bb7.tar.gz
rust-2f15dcd4d3865f9cc466637027eb02d5607b2bb7.zip
auto merge of #17584 : pcwalton/rust/range-patterns-dotdotdot, r=nick29581
This breaks code that looks like:

    match foo {
        1..3 => { ... }
    }

Instead, write:

    match foo {
        1...3 => { ... }
    }

Closes #17295.

r? @nick29581 
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 0780e68a062..c8f1b7f9a8e 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -3256,8 +3256,7 @@ impl<'a> Parser<'a> {
             // These expressions are limited to literals (possibly
             // preceded by unary-minus) or identifiers.
             let val = self.parse_literal_maybe_minus();
-            // FIXME(#17295) remove the DOTDOT option.
-            if (self.token == token::DOTDOTDOT || self.token == token::DOTDOT) &&
+            if (self.token == token::DOTDOTDOT) &&
                     self.look_ahead(1, |t| {
                         *t != token::COMMA && *t != token::RBRACKET
                     }) {
@@ -3302,16 +3301,12 @@ impl<'a> Parser<'a> {
                 }
             });
 
-            // FIXME(#17295) remove the DOTDOT option.
-            if self.look_ahead(1, |t| *t == token::DOTDOTDOT || *t == token::DOTDOT) &&
+            if self.look_ahead(1, |t| *t == token::DOTDOTDOT) &&
                     self.look_ahead(2, |t| {
                         *t != token::COMMA && *t != token::RBRACKET
                     }) {
                 let start = self.parse_expr_res(RestrictionNoBarOp);
-                // FIXME(#17295) remove the DOTDOT option (self.eat(&token::DOTDOTDOT)).
-                if self.token == token::DOTDOTDOT || self.token == token::DOTDOT {
-                    self.bump();
-                }
+                self.eat(&token::DOTDOTDOT);
                 let end = self.parse_expr_res(RestrictionNoBarOp);
                 pat = PatRange(start, end);
             } else if is_plain_ident(&self.token) && !can_be_enum_or_struct {