Skip to content

Commit 688a39f

Browse files
committed
---
yaml --- r: 29784 b: refs/heads/incoming c: 55ee06b h: refs/heads/master v: v3
1 parent 643fd57 commit 688a39f

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 36d8682269fb29a10da93634cff4a9320c45a2f4
9+
refs/heads/incoming: 55ee06b8ce70cf86e9df7e501f700cc3e520376d
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libsyntax/parse/lexer.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,8 @@ fn scan_number(c: char, rdr: string_reader) -> token::token {
377377
}
378378
}
379379
let mut is_float = false;
380-
if rdr.curr == '.' && !(is_alpha(nextch(rdr)) || nextch(rdr) == '_') {
380+
if rdr.curr == '.' && !(is_alpha(nextch(rdr)) || nextch(rdr) == '_' ||
381+
nextch(rdr) == '.') {
381382
is_float = true;
382383
bump(rdr);
383384
let dec_part = scan_digits(rdr, 10u);

branches/incoming/src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1797,7 +1797,7 @@ class parser {
17971797
|| self.is_keyword(~"false")
17981798
{
17991799
let val = self.parse_expr_res(RESTRICT_NO_BAR_OP);
1800-
if self.eat_keyword(~"to") {
1800+
if self.eat_keyword(~"to") || self.eat(token::DOTDOT) {
18011801
let end = self.parse_expr_res(RESTRICT_NO_BAR_OP);
18021802
pat = pat_range(val, end);
18031803
} else {

branches/incoming/src/libsyntax/print/pprust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1512,7 +1512,7 @@ fn print_pat(s: ps, &&pat: @ast::pat) {
15121512
ast::pat_range(begin, end) => {
15131513
print_expr(s, begin);
15141514
space(s.s);
1515-
word_space(s, ~"to");
1515+
word(s.s, ~"..");
15161516
print_expr(s, end);
15171517
}
15181518
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
fn main() {
22
match 5u {
3-
1u to 5u => {}
3+
1u..5u => {}
44
_ => fail ~"should match range",
55
}
66
match 5u {
7-
6u to 7u => fail ~"shouldn't match range",
7+
6u..7u => fail ~"shouldn't match range",
88
_ => {}
99
}
1010
match check 5u {
1111
1u => fail ~"should match non-first range",
12-
2u to 6u => {}
12+
2u..6u => {}
1313
}
1414
match 'c' {
15-
'a' to 'z' => {}
15+
'a'..'z' => {}
1616
_ => fail ~"should suppport char ranges"
1717
}
1818
match -3 {
19-
-7 to 5 => {}
19+
-7..5 => {}
2020
_ => fail ~"should match signed range"
2121
}
2222
match 3.0 {
23-
1.0 to 5.0 => {}
23+
1.0..5.0 => {}
2424
_ => fail ~"should match float range"
2525
}
2626
match -1.5 {
27-
-3.6 to 3.6 => {}
27+
-3.6..3.6 => {}
2828
_ => fail ~"should match negative float range"
2929
}
3030
}

0 commit comments

Comments
 (0)