@@ -417,12 +417,12 @@ pub enum MapChain<K,V> {
417417// get the map from an env frame
418418impl < K : Eq + Hash + IterBytes + ' static , V : ' static > MapChain < K , V > {
419419 // Constructor. I don't think we need a zero-arg one.
420- fn new ( init : ~HashMap < K , @V > ) -> @mut MapChain < K , V > {
420+ pub fn new ( init : ~HashMap < K , @V > ) -> @mut MapChain < K , V > {
421421 @mut BaseMapChain ( init)
422422 }
423423
424424 // add a new frame to the environment (functionally)
425- fn push_frame ( @mut self ) -> @mut MapChain < K , V > {
425+ pub fn push_frame ( @mut self ) -> @mut MapChain < K , V > {
426426 @mut ConsMapChain ( ~HashMap :: new ( ) , self )
427427 }
428428
@@ -432,7 +432,7 @@ impl <K: Eq + Hash + IterBytes + 'static, V: 'static> MapChain<K,V>{
432432
433433 // ugh: can't get this to compile with mut because of the
434434 // lack of flow sensitivity.
435- fn get_map < ' a > ( & ' a self ) -> & ' a HashMap < K , @V > {
435+ pub fn get_map < ' a > ( & ' a self ) -> & ' a HashMap < K , @V > {
436436 match * self {
437437 BaseMapChain ( ~ref map) => map,
438438 ConsMapChain ( ~ref map, _) => map
@@ -442,7 +442,7 @@ impl <K: Eq + Hash + IterBytes + 'static, V: 'static> MapChain<K,V>{
442442// traits just don't work anywhere...?
443443//impl Map<Name,SyntaxExtension> for MapChain {
444444
445- fn contains_key ( & self , key : & K ) -> bool {
445+ pub fn contains_key ( & self , key : & K ) -> bool {
446446 match * self {
447447 BaseMapChain ( ref map) => map. contains_key ( key) ,
448448 ConsMapChain ( ref map, ref rest) =>
@@ -453,17 +453,17 @@ impl <K: Eq + Hash + IterBytes + 'static, V: 'static> MapChain<K,V>{
453453 // should each_key and each_value operate on shadowed
454454 // names? I think not.
455455 // delaying implementing this....
456- fn each_key ( & self , _f : & fn ( & K ) ->bool ) {
456+ pub fn each_key ( & self , _f : & fn ( & K ) ->bool ) {
457457 fail ! ( "unimplemented 2013-02-15T10:01" ) ;
458458 }
459459
460- fn each_value ( & self , _f : & fn ( & V ) -> bool ) {
460+ pub fn each_value ( & self , _f : & fn ( & V ) -> bool ) {
461461 fail ! ( "unimplemented 2013-02-15T10:02" ) ;
462462 }
463463
464464 // Returns a copy of the value that the name maps to.
465465 // Goes down the chain 'til it finds one (or bottom out).
466- fn find ( & self , key : & K ) -> Option < @V > {
466+ pub fn find ( & self , key : & K ) -> Option < @V > {
467467 match self . get_map ( ) . find ( key) {
468468 Some ( ref v) => Some ( * * v) ,
469469 None => match * self {
@@ -473,7 +473,7 @@ impl <K: Eq + Hash + IterBytes + 'static, V: 'static> MapChain<K,V>{
473473 }
474474 }
475475
476- fn find_in_topmost_frame ( & self , key : & K ) -> Option < @V > {
476+ pub fn find_in_topmost_frame ( & self , key : & K ) -> Option < @V > {
477477 let map = match * self {
478478 BaseMapChain ( ref map) => map,
479479 ConsMapChain ( ref map, _) => map
@@ -483,7 +483,7 @@ impl <K: Eq + Hash + IterBytes + 'static, V: 'static> MapChain<K,V>{
483483 }
484484
485485 // insert the binding into the top-level map
486- fn insert ( & mut self , key : K , ext : @V ) -> bool {
486+ pub fn insert ( & mut self , key : K , ext : @V ) -> bool {
487487 // can't abstract over get_map because of flow sensitivity...
488488 match * self {
489489 BaseMapChain ( ~ref mut map) => map. insert ( key, ext) ,
@@ -495,7 +495,7 @@ impl <K: Eq + Hash + IterBytes + 'static, V: 'static> MapChain<K,V>{
495495 // ... there are definitely some opportunities for abstraction
496496 // here that I'm ignoring. (e.g., manufacturing a predicate on
497497 // the maps in the chain, and using an abstract "find".
498- fn insert_into_frame( & mut self , key : K , ext : @V , n : K , pred : & fn ( & @V ) ->bool ) {
498+ pub fn insert_into_frame( & mut self , key : K , ext : @V , n : K , pred : & fn ( & @V ) ->bool ) {
499499 match * self {
500500 BaseMapChain ( ~ref mut map) => {
501501 if satisfies_pred ( map, & n, pred) {
0 commit comments