Skip to content

Commit d35f84e

Browse files
committed
---
yaml --- r: 50030 b: refs/heads/auto c: b0bea10 h: refs/heads/master v: v3
1 parent 4dce034 commit d35f84e

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 049e1f9a1f60cfbc4136bd8496737e707ca05a42
17+
refs/heads/auto: b0bea108983446aaa33ecabdd44954e03d5c65e0
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,9 +642,9 @@ pub impl Parser {
642642
self.obsolete(*self.last_span, ObsoleteMutVector);
643643
}
644644

645-
// Parse the `* e` in `[ int * e ]`
645+
// Parse the `, ..e` in `[ int, ..e ]`
646646
// where `e` is a const expression
647-
let t = match self.maybe_parse_fixed_vstore_with_star() {
647+
let t = match self.maybe_parse_fixed_vstore() {
648648
None => ty_vec(mt),
649649
Some(suffix) => ty_fixed_length_vec(mt, suffix)
650650
};
@@ -815,8 +815,14 @@ pub impl Parser {
815815
})
816816
}
817817

818-
fn maybe_parse_fixed_vstore_with_star(&self) -> Option<@ast::expr> {
818+
fn maybe_parse_fixed_vstore(&self) -> Option<@ast::expr> {
819819
if self.eat(&token::BINOP(token::STAR)) {
820+
// XXX: Obsolete; remove after snapshot.
821+
Some(self.parse_expr())
822+
} else if *self.token == token::COMMA &&
823+
self.look_ahead(1) == token::DOTDOT {
824+
self.bump();
825+
self.bump();
820826
Some(self.parse_expr())
821827
} else {
822828
None

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ pub fn print_type_ex(s: @ps, &&ty: @ast::Ty, print_colons: bool) {
424424
ast::m_imm => ()
425425
}
426426
print_type(s, mt.ty);
427-
word(s.s, ~" * ");
427+
word(s.s, ~", ..");
428428
print_expr(s, v);
429429
word(s.s, ~"]");
430430
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use core::io::println;
2+
3+
static FOO: [int, ..3] = [1, 2, 3];
4+
5+
fn main() {
6+
println(fmt!("%d %d %d", FOO[0], FOO[1], FOO[2]));
7+
}
8+
9+
10+

0 commit comments

Comments
 (0)