about summary refs log tree commit diff
path: root/src/libsyntax/parse
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
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')
-rw-r--r--src/libsyntax/parse/lexer/mod.rs2
-rw-r--r--src/libsyntax/parse/parser.rs11
2 files changed, 4 insertions, 9 deletions
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs
index 68ddd17dd01..38c985af370 100644
--- a/src/libsyntax/parse/lexer/mod.rs
+++ b/src/libsyntax/parse/lexer/mod.rs
@@ -637,7 +637,7 @@ impl<'a> StringReader<'a> {
                 'b' => { self.bump(); base = 2; num_digits = self.scan_digits(2); }
                 'o' => { self.bump(); base = 8; num_digits = self.scan_digits(8); }
                 'x' => { self.bump(); base = 16; num_digits = self.scan_digits(16); }
-                '0'..'9' | '_' | '.' => {
+                '0'...'9' | '_' | '.' => {
                     num_digits = self.scan_digits(10) + 1;
                 }
                 'u' | 'i' => {
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 {