File tree Expand file tree Collapse file tree 4 files changed +22
-8
lines changed Expand file tree Collapse file tree 4 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9
- refs/heads/incoming: c7ed9908d6023a278b2a53711abea50d186b71bc
9
+ refs/heads/incoming: 87f4c153110743844e4b3a4bb9dcde31a5ef3eb4
10
10
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
12
12
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -928,15 +928,16 @@ class parser {
928
928
!self . is_keyword ( ~"with") {
929
929
self . expect ( token:: COMMA ) ;
930
930
if self . token == token:: RBRACE ||
931
- self . is_keyword ( ~"with") {
931
+ self . is_keyword ( ~"with") ||
932
+ self . token == token:: DOTDOT {
932
933
// Accept an optional trailing comma.
933
934
break ;
934
935
}
935
936
vec:: push ( fields, self . parse_field ( token:: COLON ) ) ;
936
937
}
937
938
938
939
let base;
939
- if self . eat_keyword ( ~"with") {
940
+ if self . eat_keyword ( ~"with") || self . eat ( token :: DOTDOT ) {
940
941
base = some ( self . parse_expr ( ) ) ;
941
942
} else {
942
943
base = none;
@@ -1548,6 +1549,16 @@ class parser {
1548
1549
let mut fields = ~[ self . parse_field ( token:: COLON ) ] ;
1549
1550
let mut base = none;
1550
1551
while self . token != token:: RBRACE {
1552
+ if self . token == token:: COMMA
1553
+ && self . look_ahead ( 1 ) == token:: DOTDOT {
1554
+ self . bump ( ) ;
1555
+ self . bump ( ) ;
1556
+ base = some ( self . parse_expr ( ) ) ; break ;
1557
+ }
1558
+
1559
+ // XXX: Remove "with" after all code is converted over and there's
1560
+ // a snapshot.
1561
+
1551
1562
// optional comma before "with"
1552
1563
if self . token == token:: COMMA
1553
1564
&& self . token_is_keyword ( ~"with",
Original file line number Diff line number Diff line change @@ -1039,7 +1039,9 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
1039
1039
some(expr) => {
1040
1040
if vec::len(fields) > 0u { space(s.s); }
1041
1041
ibox(s, indent_unit);
1042
- word_space(s, ~" with") ;
1042
+ word(s.s, ~" , ");
1043
+ space(s.s);
1044
+ word(s.s, ~" ..");
1043
1045
print_expr(s, expr);
1044
1046
end(s);
1045
1047
}
@@ -1055,7 +1057,9 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
1055
1057
some(expr) => {
1056
1058
if vec::len(fields) > 0u { space(s.s); }
1057
1059
ibox(s, indent_unit);
1058
- word_space(s, ~" with") ;
1060
+ word(s.s, ~" , ");
1061
+ space(s.s);
1062
+ word(s.s, ~" ..");
1059
1063
print_expr(s, expr);
1060
1064
end(s);
1061
1065
}
Original file line number Diff line number Diff line change @@ -5,8 +5,7 @@ struct Foo {
5
5
6
6
fn main ( ) {
7
7
let a = Foo { x : 1 , y : 2 } ;
8
- let b = Foo { x : 3 with a } ;
9
- let c = Foo { x : 4 , with a } ;
10
- io:: println ( fmt ! ( "%? %?" , b, c) ) ;
8
+ let c = Foo { x : 4 , .. a } ;
9
+ io:: println ( fmt ! ( "%?" , c) ) ;
11
10
}
12
11
You can’t perform that action at this time.
0 commit comments