Skip to content

Commit dd08894

Browse files
committed
---
yaml --- r: 4179 b: refs/heads/master c: 06e1d8b h: refs/heads/master i: 4177: 03a1dc2 4175: 9e20849 v: v3
1 parent 3f6e7e0 commit dd08894

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 8365a79c7cac863343487cd73ffdedb3d2192d07
2+
refs/heads/master: 06e1d8b745bf73887390ed21ca58ae5688cbe208

trunk/src/comp/syntax/print/pprust.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -615,9 +615,7 @@ fn print_if(s: &ps, test: &@ast::expr, blk: &ast::blk,
615615
cbox(s, indent_unit - 1u);
616616
ibox(s, 0u);
617617
word(s.s, " else if ");
618-
popen(s);
619618
print_expr(s, i);
620-
pclose(s);
621619
space(s.s);
622620
print_block(s, t);
623621
do_else(s, e);
@@ -775,19 +773,13 @@ fn print_expr(s: &ps, expr: &@ast::expr) {
775773
}
776774
ast::expr_for(decl, expr, blk) {
777775
head(s, "for");
778-
print_for_decl(s, decl);
779-
space(s.s);
780-
word_space(s, "in");
781-
print_expr(s, expr);
776+
print_for_decl(s, decl, expr);
782777
space(s.s);
783778
print_block(s, blk);
784779
}
785780
ast::expr_for_each(decl, expr, blk) {
786781
head(s, "for each");
787-
print_for_decl(s, decl);
788-
space(s.s);
789-
word_space(s, "in");
790-
print_expr(s, expr);
782+
print_for_decl(s, decl, expr);
791783
space(s.s);
792784
print_block(s, blk);
793785
}
@@ -1043,13 +1035,15 @@ fn print_decl(s: &ps, decl: &@ast::decl) {
10431035

10441036
fn print_ident(s: &ps, ident: &ast::ident) { word(s.s, ident); }
10451037

1046-
fn print_for_decl(s: &ps, loc: @ast::local) {
1038+
fn print_for_decl(s: &ps, loc: &@ast::local, coll: &@ast::expr) {
10471039
word(s.s, loc.node.ident);
10481040
alt loc.node.ty {
10491041
some(t) { word_space(s, ":"); print_type(s, *t); }
10501042
none. { }
10511043
}
10521044
space(s.s);
1045+
word_space(s, "in");
1046+
print_expr(s, coll);
10531047
}
10541048

10551049
fn print_path(s: &ps, path: &ast::path) {

0 commit comments

Comments
 (0)