about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorMichael Sullivan <sully@msully.net>2011-07-21 18:14:39 -0700
committerMichael Sullivan <sully@msully.net>2011-07-21 18:14:39 -0700
commit4b59ae0aa9051e6a5fbec43d0c9bb8a12c0711e0 (patch)
tree9b5960aaa6d03643d2052bfebff73d56ec203251 /src/comp
parentcb024253765c9537d1fa1f789caa4d3f9afe03e8 (diff)
Add some support for using a map like a set.
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/middle/ast_map.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/comp/middle/ast_map.rs b/src/comp/middle/ast_map.rs
index aa71242f9c8..78f99f75f18 100644
--- a/src/comp/middle/ast_map.rs
+++ b/src/comp/middle/ast_map.rs
@@ -105,6 +105,11 @@ fn new_smallintmap_adapter[K, V](fn(&K) -> uint key_idx,
                 idx += 1u;
             }
         }
+        iter keys() -> K {
+            for each (@tup(K, V) p in self.items()) {
+                put p._0;
+            }
+        }
     }
 
     auto map = smallintmap::mk[V]();