diff options
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/lexer.rs | 3 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index 69dde491bdf..23f5eac07df 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -377,7 +377,8 @@ fn scan_number(c: char, rdr: string_reader) -> token::token { } } let mut is_float = false; - if rdr.curr == '.' && !(is_alpha(nextch(rdr)) || nextch(rdr) == '_') { + if rdr.curr == '.' && !(is_alpha(nextch(rdr)) || nextch(rdr) == '_' || + nextch(rdr) == '.') { is_float = true; bump(rdr); let dec_part = scan_digits(rdr, 10u); diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index b50d4be4ae0..685a6a34405 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1797,7 +1797,7 @@ class parser { || self.is_keyword(~"false") { let val = self.parse_expr_res(RESTRICT_NO_BAR_OP); - if self.eat_keyword(~"to") { + if self.eat_keyword(~"to") || self.eat(token::DOTDOT) { let end = self.parse_expr_res(RESTRICT_NO_BAR_OP); pat = pat_range(val, end); } else { |
