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).
This commit is contained in:
Tim Chevalier 2012-03-28 18:50:33 -07:00
parent fe610f04d8
commit f7bbe537c1
18 changed files with 201 additions and 198 deletions

View file

@ -218,10 +218,9 @@ fn visit_ids(item: ast::inlined_item, vfn: fn@(ast::node_id)) {
}
},
visit_class_item: fn@(_s: span, _p: ast::privacy,
c: ast::class_member) {
alt c {
ast::instance_var(_, _, _, id) {
visit_class_item: fn@(c: @ast::class_member) {
alt c.node {
ast::instance_var(_, _, _, id,_) {
vfn(id)
}
ast::class_method(_) {