Don't pretty-print extra blank lines after anon object methods

This commit is contained in:
Brian Anderson 2011-08-18 21:04:23 -07:00
parent bc998c6140
commit 8c3ed8640b
2 changed files with 19 additions and 2 deletions

View file

@ -1067,12 +1067,15 @@ fn print_expr(s: &ps, expr: &@ast::expr) {
word(s.s, " ");
print_block(s, meth.node.meth.body);
}
space(s.s);
// With object
alt anon_obj.inner_obj {
none. { }
some(e) { word_space(s, "with"); print_expr(s, e); }
some(e) {
space(s.s);
word_space(s, "with");
print_expr(s, e);
}
}
bclose(s, expr.span);
}

View file

@ -0,0 +1,14 @@
// pp-exact
fn main() {
let my_obj =
obj () {
fn foo() { }
};
let my_ext_obj =
obj () {
fn foo() { }
with
my_obj
};
}