syntax: Pretty print impls with new syntax
This commit is contained in:
parent
436a90e3d7
commit
99a571585c
1 changed files with 8 additions and 7 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue