libsyntax: Pretty print using the new impl syntax. r=brson
This commit is contained in:
parent
5e6d7871c6
commit
754718c910
3 changed files with 6 additions and 4 deletions
|
@ -554,15 +554,17 @@ pub fn print_item(s: @ps, &&item: @ast::item) {
|
||||||
print_type_params(s, tps);
|
print_type_params(s, tps);
|
||||||
space(s.s);
|
space(s.s);
|
||||||
}
|
}
|
||||||
print_type(s, ty);
|
|
||||||
|
|
||||||
match opt_trait {
|
match opt_trait {
|
||||||
Some(t) => {
|
Some(t) => {
|
||||||
word_space(s, ~":");
|
|
||||||
print_path(s, t.path, false);
|
print_path(s, t.path, false);
|
||||||
|
space(s.s);
|
||||||
|
word_space(s, ~"for");
|
||||||
}
|
}
|
||||||
None => ()
|
None => ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
print_type(s, ty);
|
||||||
space(s.s);
|
space(s.s);
|
||||||
|
|
||||||
if methods.len() == 0 {
|
if methods.len() == 0 {
|
||||||
|
|
|
@ -14,7 +14,7 @@ struct cat {
|
||||||
name: ~str,
|
name: ~str,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl cat: Drop {
|
impl Drop for cat {
|
||||||
#[cat_dropper]
|
#[cat_dropper]
|
||||||
fn finalize(&self) { error!("%s landed on hir feet" , self . name); }
|
fn finalize(&self) { error!("%s landed on hir feet" , self . name); }
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ trait frobable {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[int_frobable]
|
#[int_frobable]
|
||||||
impl int: frobable {
|
impl frobable for int {
|
||||||
#[frob_attr1]
|
#[frob_attr1]
|
||||||
fn frob() {
|
fn frob() {
|
||||||
#[frob_attr2];
|
#[frob_attr2];
|
||||||
|
|
Loading…
Reference in a new issue