syntax: Pretty-print 'do' correctly
This commit is contained in:
parent
ba6f71f1b8
commit
8b2491160d
@ -879,6 +879,7 @@ fn print_field(s: ps, field: ast::field) {
|
|||||||
let blk_arg = vec::pop(base_args);
|
let blk_arg = vec::pop(base_args);
|
||||||
alt blk_arg.node {
|
alt blk_arg.node {
|
||||||
ast::expr_loop_body(_) { word_nbsp(s, "for"); }
|
ast::expr_loop_body(_) { word_nbsp(s, "for"); }
|
||||||
|
ast::expr_do_body(_) { word_nbsp(s, "do"); }
|
||||||
_ {}
|
_ {}
|
||||||
}
|
}
|
||||||
some(blk_arg)
|
some(blk_arg)
|
||||||
|
7
src/test/pretty/do1.rs
Normal file
7
src/test/pretty/do1.rs
Normal file
@ -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
Block a user