diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2013-06-12 04:55:16 +0200 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2013-06-12 13:04:37 +0200 |
| commit | ecef9ad75adb929521e3e6a3cd2137964f7cd36c (patch) | |
| tree | 10ff4db09a5ec2228bc5c4a3831f51528a4f0ca7 /src/libsyntax/ext | |
| parent | 135ba946a233c1d32b98943180d3eaacc9ff26f2 (diff) | |
Visitor refactoring: Step 1, couple (Env, vt<Env>) together in a tuple.
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 96ea5ecf92c..a23512116c1 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -372,7 +372,7 @@ pub fn expand_stmt(extsbox: @mut SyntaxEnv, pub fn new_name_finder() -> @Visitor<@mut ~[ast::ident]> { let default_visitor = visit::default_visitor(); @Visitor{ - visit_pat : |p:@ast::pat,ident_accum:@mut ~[ast::ident],v:visit::vt<@mut ~[ast::ident]>| { + visit_pat : |p:@ast::pat,(ident_accum, v): (@mut ~[ast::ident], visit::vt<@mut ~[ast::ident]>)| { match *p { // we found a pat_ident! ast::pat{id:_, node: ast::pat_ident(_,path,ref inner), span:_} => { @@ -385,11 +385,11 @@ pub fn new_name_finder() -> @Visitor<@mut ~[ast::ident]> { } // visit optional subpattern of pat_ident: for inner.iter().advance |subpat: &@ast::pat| { - (v.visit_pat)(*subpat, ident_accum, v) + (v.visit_pat)(*subpat, (ident_accum, v)) } } // use the default traversal for non-pat_idents - _ => visit::visit_pat(p,ident_accum,v) + _ => visit::visit_pat(p,(ident_accum,v)) } }, .. *default_visitor |
