diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index e75181eb89b..0eaf6849b7e 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -414,8 +414,8 @@ pub fn get_exprs_from_tts(cx: ext_ctxt, tts: ~[ast::token_tree]) // a transformer env is either a base map or a map on top // of another chain. pub enum MapChain { - TEC_Base(~LinearMap), - TEC_Cons(~LinearMap,@mut MapChain) + BaseMapChain(~LinearMap), + ConsMapChain(~LinearMap,@mut MapChain) } @@ -424,12 +424,12 @@ impl MapChain{ // Constructor. I don't think we need a zero-arg one. static fn new(+init: ~LinearMap) -> @mut MapChain { - @mut TEC_Base(init) + @mut BaseMapChain(init) } // add a new frame to the environment (functionally) fn push_frame (@mut self) -> @mut MapChain { - @mut TEC_Cons(~LinearMap::new() ,self) + @mut ConsMapChain(~LinearMap::new() ,self) } // no need for pop, it'll just be functional. @@ -440,8 +440,8 @@ impl MapChain{ // lack of flow sensitivity. fn get_map(&self) -> &self/LinearMap { match *self { - TEC_Base (~ref map) => map, - TEC_Cons (~ref map,_) => map + BaseMapChain (~ref map) => map, + ConsMapChain (~ref map,_) => map } } @@ -450,8 +450,8 @@ impl MapChain{ pure fn contains_key (&self, key: &K) -> bool { match *self { - TEC_Base (ref map) => map.contains_key(key), - TEC_Cons (ref map,ref rest) => + BaseMapChain (ref map) => map.contains_key(key), + ConsMapChain (ref map,ref rest) => (map.contains_key(key) || rest.contains_key(key)) } @@ -473,8 +473,8 @@ impl MapChain{ match self.get_map().find (key) { Some(ref v) => Some(**v), None => match *self { - TEC_Base (_) => None, - TEC_Cons (_,ref rest) => rest.find(key) + BaseMapChain (_) => None, + ConsMapChain (_,ref rest) => rest.find(key) } } } @@ -483,8 +483,8 @@ impl MapChain{ fn insert (&mut self, +key: K, +ext: @V) -> bool { // can't abstract over get_map because of flow sensitivity... match *self { - TEC_Base (~ref mut map) => map.insert(key, ext), - TEC_Cons (~ref mut map,_) => map.insert(key,ext) + BaseMapChain (~ref mut map) => map.insert(key, ext), + ConsMapChain (~ref mut map,_) => map.insert(key,ext) } } diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 0655a5efbf4..9a3e8da2b81 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -195,7 +195,7 @@ fn contains_macro_escape (attrs: &[ast::attribute]) -> bool{ macro_rules! without_macro_scoping( ($extsexpr:expr,$exp:expr) => ({ - // only evaluaate this once: + // only evaluate this once: let exts = $extsexpr; // capture the existing binding: let existingBlockBinding = @@ -421,8 +421,6 @@ pub fn core_macros() -> ~str { }"; } -// could cfg just be a borrowed pointer here? - pub fn expand_crate(parse_sess: @mut parse::ParseSess, cfg: ast::crate_cfg, c: @crate) -> @crate { // adding *another* layer of indirection here so that the block