1
Fork 0

Change syntax for impl

Move the name of the bundle to the front, allow type parameters (not
handled yet), and add a 'for' keyword:

    impl utils for int {
        fn str() -> str { int::str(self) }
        fn times(f: block()) { ... }
    }
This commit is contained in:
Marijn Haverbeke 2011-12-16 10:42:28 +01:00
parent 4f826d81f6
commit cff6bdd036
6 changed files with 34 additions and 20 deletions

View file

@ -235,8 +235,8 @@ fn noop_fold_item_underscore(i: item_, fld: ast_fold) -> item_ {
methods: vec::map(fld.fold_method, o.methods)},
typms, d)
}
item_impl(iface, ty, methods) {
item_impl(fld.fold_path(iface), fld.fold_ty(ty),
item_impl(tps, ty, methods) {
item_impl(tps, fld.fold_ty(ty),
vec::map(fld.fold_method, methods))
}
item_res(dtor, did, typms, cid) {