diff options
Diffstat (limited to 'src/comp/syntax/parse')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 6869dc6501d..efed1380a23 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -1494,8 +1494,14 @@ fn parse_pat(p: parser) -> @ast::pat { tok { if !is_ident(tok) || is_word(p, "true") || is_word(p, "false") { let lit = parse_lit(p); - hi = lit.span.hi; - pat = ast::pat_lit(@lit); + if eat_word(p, "to") { + let end = parse_lit(p); + hi = end.span.hi; + pat = ast::pat_range(@lit, @end); + } else { + hi = lit.span.hi; + pat = ast::pat_lit(@lit); + } } else if is_plain_ident(p) && alt p.look_ahead(1u) { token::DOT. | token::LPAREN. | token::LBRACKET. { |
