mirror of https://github.com/rust-lang/rust.git
syntax: Pretty-print 'do' correctly
This commit is contained in:
parent
ba6f71f1b8
commit
8b2491160d
|
@ -879,6 +879,7 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
|
|||
let blk_arg = vec::pop(base_args);
|
||||
alt blk_arg.node {
|
||||
ast::expr_loop_body(_) { word_nbsp(s, "for"); }
|
||||
ast::expr_do_body(_) { word_nbsp(s, "do"); }
|
||||
_ {}
|
||||
}
|
||||
some(blk_arg)
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
// pretty-exact
|
||||
|
||||
fn f(f: fn@(int)) { f(10) }
|
||||
|
||||
fn main() {
|
||||
do f { |i| assert i == 10 }
|
||||
}
|
Loading…
Reference in New Issue