Don't pretty-print extra blank lines after anon object methods
This commit is contained in:
parent
bc998c6140
commit
8c3ed8640b
2 changed files with 19 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
14
src/test/pretty/anon-obj.rs
Normal file
14
src/test/pretty/anon-obj.rs
Normal 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
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue