@@ -414,8 +414,8 @@ pub fn get_exprs_from_tts(cx: ext_ctxt, tts: ~[ast::token_tree])
414
414
// a transformer env is either a base map or a map on top
415
415
// of another chain.
416
416
pub enum MapChain < K , V > {
417
- TEC_Base ( ~LinearMap < K , @V > ) ,
418
- TEC_Cons ( ~LinearMap < K , @V > , @mut MapChain < K , V > )
417
+ BaseMapChain ( ~LinearMap < K , @V > ) ,
418
+ ConsMapChain ( ~LinearMap < K , @V > , @mut MapChain < K , V > )
419
419
}
420
420
421
421
@@ -424,12 +424,12 @@ impl <K: Eq + Hash + IterBytes ,V: Copy> MapChain<K,V>{
424
424
425
425
// Constructor. I don't think we need a zero-arg one.
426
426
static fn new( +init: ~LinearMap < K , @V > ) -> @mut MapChain <K , V > {
427
- @mut TEC_Base ( init)
427
+ @mut BaseMapChain ( init)
428
428
}
429
429
430
430
// add a new frame to the environment (functionally)
431
431
fn push_frame ( @mut self ) -> @mut MapChain < K , V > {
432
- @mut TEC_Cons ( ~LinearMap :: new ( ) , self )
432
+ @mut ConsMapChain ( ~LinearMap :: new ( ) , self )
433
433
}
434
434
435
435
// no need for pop, it'll just be functional.
@@ -440,8 +440,8 @@ impl <K: Eq + Hash + IterBytes ,V: Copy> MapChain<K,V>{
440
440
// lack of flow sensitivity.
441
441
fn get_map ( & self ) -> & self /LinearMap < K , @V > {
442
442
match * self {
443
- TEC_Base ( ~ref map) => map,
444
- TEC_Cons ( ~ref map, _) => map
443
+ BaseMapChain ( ~ref map) => map,
444
+ ConsMapChain ( ~ref map, _) => map
445
445
}
446
446
}
447
447
@@ -450,8 +450,8 @@ impl <K: Eq + Hash + IterBytes ,V: Copy> MapChain<K,V>{
450
450
451
451
pure fn contains_key ( & self , key : & K ) -> bool {
452
452
match * self {
453
- TEC_Base ( ref map) => map. contains_key ( key) ,
454
- TEC_Cons ( ref map, ref rest) =>
453
+ BaseMapChain ( ref map) => map. contains_key ( key) ,
454
+ ConsMapChain ( ref map, ref rest) =>
455
455
( map. contains_key ( key)
456
456
|| rest. contains_key ( key) )
457
457
}
@@ -473,8 +473,8 @@ impl <K: Eq + Hash + IterBytes ,V: Copy> MapChain<K,V>{
473
473
match self.get_map().find (key) {
474
474
Some(ref v) => Some(**v),
475
475
None => match *self {
476
- TEC_Base (_) => None,
477
- TEC_Cons (_,ref rest) => rest.find(key)
476
+ BaseMapChain (_) => None,
477
+ ConsMapChain (_,ref rest) => rest.find(key)
478
478
}
479
479
}
480
480
}
@@ -483,8 +483,8 @@ impl <K: Eq + Hash + IterBytes ,V: Copy> MapChain<K,V>{
483
483
fn insert (&mut self, +key: K, +ext: @V) -> bool {
484
484
// can't abstract over get_map because of flow sensitivity...
485
485
match *self {
486
- TEC_Base (~ref mut map) => map.insert(key, ext),
487
- TEC_Cons (~ref mut map,_) => map.insert(key,ext)
486
+ BaseMapChain (~ref mut map) => map.insert(key, ext),
487
+ ConsMapChain (~ref mut map,_) => map.insert(key,ext)
488
488
}
489
489
}
490
490
0 commit comments