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:
parent
fe610f04d8
commit
f7bbe537c1
18 changed files with 201 additions and 198 deletions
|
|
@ -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(_) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue