// from a given thingy and puts them in a mutable
// array (passed in to the traversal).
#[deriving(Clone)]
-pub struct NewNameFinderContext {
+struct NameFinderContext {
ident_accumulator: Vec<ast::Ident> ,
}
-impl Visitor<()> for NewNameFinderContext {
+impl Visitor<()> for NameFinderContext {
fn visit_pat(&mut self, pattern: &ast::Pat, _: ()) {
match *pattern {
// we found a pat_ident!
// return a visitor that extracts the pat_ident paths
// from a given thingy and puts them in a mutable
// array (passed in to the traversal)
-pub fn new_name_finder(idents: Vec<ast::Ident> ) -> NewNameFinderContext {
- NewNameFinderContext {
+fn new_name_finder(idents: Vec<ast::Ident> ) -> NameFinderContext {
+ NameFinderContext {
ident_accumulator: idents,
}
}
#[cfg(test)]
mod test {
- use super::*;
+ use super::{new_name_finder, expand_crate, contains_macro_escape};
use ast;
use ast::{Attribute_, AttrOuter, MetaWord};
use attr;
// from a given thingy and puts them in a mutable
// array (passed in to the traversal)
#[deriving(Clone)]
- struct NewPathExprFinderContext {
+ struct PathExprFinderContext {
path_accumulator: Vec<ast::Path> ,
}
- impl Visitor<()> for NewPathExprFinderContext {
+ impl Visitor<()> for PathExprFinderContext {
fn visit_expr(&mut self, expr: &ast::Expr, _: ()) {
match *expr {
// return a visitor that extracts the paths
// from a given thingy and puts them in a mutable
// array (passed in to the traversal)
- pub fn new_path_finder(paths: Vec<ast::Path> ) -> NewPathExprFinderContext {
- NewPathExprFinderContext {
+ fn new_path_finder(paths: Vec<ast::Path> ) -> PathExprFinderContext {
+ PathExprFinderContext {
path_accumulator: paths
}
}