diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-03-28 18:50:33 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-03-28 20:30:07 -0700 |
| commit | f7bbe537c11b83c529d755622bc7fdb831d751cd (patch) | |
| tree | 6a822e808ac48046ab8932dbacf802036bb31150 /src/rustc/middle/ast_map.rs | |
| parent | fe610f04d89ae30e7ad68b9b519aa8461cd8d0fb (diff) | |
| download | rust-f7bbe537c11b83c529d755622bc7fdb831d751cd.tar.gz rust-f7bbe537c11b83c529d755622bc7fdb831d751cd.zip | |
Allow explicit self-calls within classes
Allow writing self.f() within a class that has a method f. In a future commit, this syntax will be required. For now, you can write either self.f() or f(). I added a "privacy" field to all methods (whether class methods or not), which allowed me to refactor the AST somewhat (getting rid of the class_item type; now there's just class_member).
Diffstat (limited to 'src/rustc/middle/ast_map.rs')
| -rw-r--r-- | src/rustc/middle/ast_map.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/rustc/middle/ast_map.rs b/src/rustc/middle/ast_map.rs index 3b9a868776b..ee91b573daa 100644 --- a/src/rustc/middle/ast_map.rs +++ b/src/rustc/middle/ast_map.rs @@ -182,10 +182,8 @@ fn map_item(i: @item, cx: ctx, v: vt) { let p = extend(cx, i.ident); for ci in items { // only need to handle methods - alt ci.node.decl { - class_method(m) { - map_method(d_id, p, m, cx); - } + alt ci.node { + class_method(m) { map_method(d_id, p, m, cx); } _ {} } } |
