diff options
| author | Lindsey Kuper <lkuper@mozilla.com> | 2011-07-28 14:43:19 -0700 |
|---|---|---|
| committer | Lindsey Kuper <lkuper@mozilla.com> | 2011-07-28 14:54:32 -0700 |
| commit | b24da1c2e5d94faace40a934720b3b200309fb41 (patch) | |
| tree | 4221f4967ef446521ad616e6f48e2318ec25be92 /src/comp/syntax | |
| parent | 73812cd3de3afe0ce492e44ad56c6696549f0b29 (diff) | |
| download | rust-b24da1c2e5d94faace40a934720b3b200309fb41.tar.gz rust-b24da1c2e5d94faace40a934720b3b200309fb41.zip | |
The names 'outer' and 'inner' make more sense than 'self' and 'with'.
(Also, some formatting and long-string cleanup.)
Diffstat (limited to 'src/comp/syntax')
| -rw-r--r-- | src/comp/syntax/ast.rs | 5 | ||||
| -rw-r--r-- | src/comp/syntax/fold.rs | 2 | ||||
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 10 | ||||
| -rw-r--r-- | src/comp/syntax/print/pprust.rs | 2 | ||||
| -rw-r--r-- | src/comp/syntax/visit.rs | 2 | ||||
| -rw-r--r-- | src/comp/syntax/walk.rs | 7 |
6 files changed, 13 insertions, 15 deletions
diff --git a/src/comp/syntax/ast.rs b/src/comp/syntax/ast.rs index 1a435f547b1..10ee106c533 100644 --- a/src/comp/syntax/ast.rs +++ b/src/comp/syntax/ast.rs @@ -529,11 +529,10 @@ type _obj = type anon_obj = // New fields and methods, if they exist. - - // with_obj: the original object being extended, if it exists. {fields: option::t[anon_obj_field[]], methods: (@method)[], - with_obj: option::t[@expr]}; + // inner_obj: the original object being extended, if it exists. + inner_obj: option::t[@expr]}; type _mod = {view_items: (@view_item)[], items: (@item)[]}; diff --git a/src/comp/syntax/fold.rs b/src/comp/syntax/fold.rs index 57b9ca78ff6..8f4e780e9f8 100644 --- a/src/comp/syntax/fold.rs +++ b/src/comp/syntax/fold.rs @@ -322,7 +322,7 @@ fn noop_fold_expr(e: &expr_, fld: ast_fold) -> expr_ { } }, methods: ivec::map(fld.fold_method, ao.methods), - with_obj: option::map(fld.fold_expr, ao.with_obj)} + inner_obj: option::map(fld.fold_expr, ao.inner_obj)} } let fold_anon_obj = bind fold_anon_obj_(_, fld); diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index e24a5127074..9590fe723e6 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -868,23 +868,23 @@ fn parse_bottom_expr(p: &parser) -> @ast::expr { parse_anon_obj_field, p)); } let meths: (@ast::method)[] = ~[]; - let with_obj: option::t[@ast::expr] = none; + let inner_obj: option::t[@ast::expr] = none; expect(p, token::LBRACE); while p.peek() != token::RBRACE { if eat_word(p, "with") { - with_obj = some(parse_expr(p)); + inner_obj = some(parse_expr(p)); } else { meths += ~[parse_method(p)]; } } hi = p.get_hi_pos(); expect(p, token::RBRACE); // fields and methods may be *additional* or *overriding* fields - // and methods if there's a with_obj, or they may be the *only* - // fields and methods if there's no with_obj. + // and methods if there's a inner_obj, or they may be the *only* + // fields and methods if there's no inner_obj. // We don't need to pull ".node" out of fields because it's not a // "spanned". let ob: ast::anon_obj = - {fields: fields, methods: meths, with_obj: with_obj}; + {fields: fields, methods: meths, inner_obj: inner_obj}; ex = ast::expr_anon_obj(ob); } else if (eat_word(p, "bind")) { let e = parse_expr_res(p, RESTRICT_NO_CALL_EXPRS); diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs index 0b76f3c27dd..f646bc1c759 100644 --- a/src/comp/syntax/print/pprust.rs +++ b/src/comp/syntax/print/pprust.rs @@ -984,7 +984,7 @@ fn print_expr(s: &ps, expr: &@ast::expr) { space(s.s); // With object - alt anon_obj.with_obj { + alt anon_obj.inner_obj { none. { } some(e) { word_space(s, "with"); print_expr(s, e); } } diff --git a/src/comp/syntax/visit.rs b/src/comp/syntax/visit.rs index 2b42cfa5651..cf24b59611f 100644 --- a/src/comp/syntax/visit.rs +++ b/src/comp/syntax/visit.rs @@ -331,7 +331,7 @@ fn visit_expr[E](ex: &@expr, e: &E, v: &vt[E]) { } } } - alt anon_obj.with_obj { + alt anon_obj.inner_obj { none. { } some(ex) { v.visit_expr(ex, e, v); } } diff --git a/src/comp/syntax/walk.rs b/src/comp/syntax/walk.rs index 30dbaa05858..75221e9acb3 100644 --- a/src/comp/syntax/walk.rs +++ b/src/comp/syntax/walk.rs @@ -356,8 +356,8 @@ fn walk_expr(v: &ast_visitor, e: @ast::expr) { ast::expr_port(_) { } ast::expr_chan(x) { walk_expr(v, x); } ast::expr_anon_obj(anon_obj) { - // Fields + // Fields alt anon_obj.fields { none. { } some(fields) { @@ -367,10 +367,9 @@ fn walk_expr(v: &ast_visitor, e: @ast::expr) { } } } - // with_obj - - alt anon_obj.with_obj { none. { } some(e) { walk_expr(v, e); } } + // inner_obj + alt anon_obj.inner_obj { none. { } some(e) { walk_expr(v, e); } } // Methods for m: @ast::method in anon_obj.methods { |
