Stop outputting spurious spaces in ivec types and empty mutable vecs

(in the pretty-printer)
This commit is contained in:
Marijn Haverbeke 2011-07-27 21:20:51 +02:00
parent a4cf804671
commit 0186176ae9
1 changed files with 9 additions and 2 deletions

View File

@ -286,7 +286,11 @@ fn print_type(s: &ps, ty: &ast::ty) {
print_type(s, *mt.ty);
if parens { pclose(s); }
word(s.s, "[");
print_mutability(s, mt.mut);
alt mt.mut {
ast::mut. { word(s.s, "mutable"); }
ast::maybe_mut. { word(s.s, "mutable?"); }
ast::imm. {}
}
word(s.s, "]");
}
ast::ty_ptr(mt) { word(s.s, "*"); print_mt(s, mt); }
@ -673,7 +677,10 @@ fn print_expr(s: &ps, expr: &@ast::expr) {
ast::sk_rc. { word(s.s, "["); }
ast::sk_unique. { word(s.s, "~["); }
}
if mut == ast::mut { word_nbsp(s, "mutable"); }
if mut == ast::mut {
word(s.s, "mutable");
if ivec::len(exprs) > 0u { nbsp(s); }
}
commasep_exprs(s, inconsistent, exprs);
word(s.s, "]");
end(s);