syntax: Pretty print impls with new syntax

This commit is contained in:
Brian Anderson 2012-08-08 16:26:10 -07:00
parent 436a90e3d7
commit 99a571585c

View file

@ -496,19 +496,20 @@ fn print_item(s: ps, &&item: @ast::item) {
}
ast::item_impl(tps, traits, ty, methods) => {
head(s, ~"impl");
word(s.s, *item.ident);
print_type_params(s, tps);
space(s.s);
if tps.is_not_empty() {
print_type_params(s, tps);
space(s.s);
}
print_type(s, ty);
if vec::len(traits) != 0u {
word_nbsp(s, ~"of");
word_space(s, ~":");
do commasep(s, inconsistent, traits) |s, p| {
print_path(s, p.path, false);
}
space(s.s);
}
word_nbsp(s, ~"for");
print_type(s, ty);
space(s.s);
bopen(s);
for methods.each |meth| {
print_method(s, meth);