about summary refs log tree commit diff
path: root/src/rustc/middle/ast_map.rs
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2012-03-28 18:50:33 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-03-28 20:30:07 -0700
commitf7bbe537c11b83c529d755622bc7fdb831d751cd (patch)
tree6a822e808ac48046ab8932dbacf802036bb31150 /src/rustc/middle/ast_map.rs
parentfe610f04d89ae30e7ad68b9b519aa8461cd8d0fb (diff)
downloadrust-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.rs6
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); }
              _ {}
            }
           }