diff options
Diffstat (limited to 'src/libsyntax/ext/base.rs')
| -rw-r--r-- | src/libsyntax/ext/base.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index cae56267f5e..92f0c7c7679 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -20,7 +20,7 @@ use parse; use parse::token; use core::vec; -use core::hashmap::LinearMap; +use core::hashmap::HashMap; // new-style macro! tt code: // @@ -125,7 +125,7 @@ pub fn syntax_expander_table() -> SyntaxEnv { fn builtin_item_tt(f: SyntaxExpanderTTItemFun) -> @Transformer { @SE(IdentTT(SyntaxExpanderTTItem{expander: f, span: None})) } - let mut syntax_expanders = LinearMap::new(); + let mut syntax_expanders = HashMap::new(); // NB identifier starts with space, and can't conflict with legal idents syntax_expanders.insert(@~" block", @ScopeMacros(true)); @@ -430,8 +430,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<K,V> { - BaseMapChain(~LinearMap<K,@V>), - ConsMapChain(~LinearMap<K,@V>,@mut MapChain<K,V>) + BaseMapChain(~HashMap<K,@V>), + ConsMapChain(~HashMap<K,@V>,@mut MapChain<K,V>) } @@ -439,13 +439,13 @@ pub enum MapChain<K,V> { impl <K: Eq + Hash + IterBytes ,V: Copy> MapChain<K,V>{ // Constructor. I don't think we need a zero-arg one. - fn new(+init: ~LinearMap<K,@V>) -> @mut MapChain<K,V> { + fn new(+init: ~HashMap<K,@V>) -> @mut MapChain<K,V> { @mut BaseMapChain(init) } // add a new frame to the environment (functionally) fn push_frame (@mut self) -> @mut MapChain<K,V> { - @mut ConsMapChain(~LinearMap::new() ,self) + @mut ConsMapChain(~HashMap::new() ,self) } // no need for pop, it'll just be functional. @@ -454,7 +454,7 @@ impl <K: Eq + Hash + IterBytes ,V: Copy> MapChain<K,V>{ // ugh: can't get this to compile with mut because of the // lack of flow sensitivity. - fn get_map(&self) -> &'self LinearMap<K,@V> { + fn get_map(&self) -> &'self HashMap<K,@V> { match *self { BaseMapChain (~ref map) => map, ConsMapChain (~ref map,_) => map @@ -509,10 +509,10 @@ impl <K: Eq + Hash + IterBytes ,V: Copy> MapChain<K,V>{ #[cfg(test)] mod test { use super::MapChain; - use core::hashmap::LinearMap; + use core::hashmap::HashMap; #[test] fn testenv () { - let mut a = LinearMap::new(); + let mut a = HashMap::new(); a.insert (@~"abc",@15); let m = MapChain::new(~a); m.insert (@~"def",@16); |
