libsyntax: Accept "1..3" as the preferred form of "1 to 3" in patterns

This commit is contained in:
Patrick Walton
2012-08-13 17:37:08 -07:00
parent 36d8682269
commit 55ee06b8ce
4 changed files with 11 additions and 10 deletions

View File

@@ -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 {