Port the compiler to the typaram foo<T> syntax.

This commit is contained in:
Erick Tryzelaar 2011-08-12 07:15:18 -07:00 committed by Graydon Hoare
parent f764f9a8cf
commit e4a0f997fb
51 changed files with 568 additions and 568 deletions

View file

@ -12,7 +12,7 @@ tag ast_node {
node_expr(@expr);
}
type map = std::map::hashmap[node_id, ast_node];
type map = std::map::hashmap<node_id, ast_node>;
fn map_crate(c: &crate) -> map {
// FIXME: This is using an adapter to convert the smallintmap
@ -29,7 +29,7 @@ fn map_crate(c: &crate) -> map {
ret map;
}
fn map_item(map: &map, i: &@item, e: &(), v: &vt[()]) {
fn map_item(map: &map, i: &@item, e: &(), v: &vt<()>) {
map.insert(i.id, node_item(i));
alt i.node {
item_obj(_, _, ctor_id) { map.insert(ctor_id, node_obj_ctor(i)); }
@ -38,17 +38,17 @@ fn map_item(map: &map, i: &@item, e: &(), v: &vt[()]) {
visit::visit_item(i, e, v);
}
fn map_native_item(map: &map, i: &@native_item, e: &(), v: &vt[()]) {
fn map_native_item(map: &map, i: &@native_item, e: &(), v: &vt<()>) {
map.insert(i.id, node_native_item(i));
visit::visit_native_item(i, e, v);
}
fn map_expr(map: &map, ex: &@expr, e: &(), v: &vt[()]) {
fn map_expr(map: &map, ex: &@expr, e: &(), v: &vt<()>) {
map.insert(ex.id, node_expr(ex));
visit::visit_expr(ex, e, v);
}
fn new_smallintmap_int_adapter[@V]() -> std::map::hashmap[int, V] {
fn new_smallintmap_int_adapter[@V]() -> std::map::hashmap<int, V> {
let key_idx = fn (key: &int) -> uint { key as uint };
let idx_key = fn (idx: &uint) -> int { idx as int };
ret new_smallintmap_adapter(key_idx, idx_key);
@ -62,10 +62,10 @@ fn new_smallintmap_int_adapter[@V]() -> std::map::hashmap[int, V] {
fn new_smallintmap_adapter[@K,
@V](key_idx: fn(&K) -> uint ,
idx_key: fn(&uint) -> K ) ->
std::map::hashmap[K, V] {
std::map::hashmap<K, V> {
obj adapter[@K,
@V](map: smallintmap::smallintmap[V],
@V](map: smallintmap::smallintmap<V>,
key_idx: fn(&K) -> uint ,
idx_key: fn(&uint) -> K ) {
@ -83,17 +83,17 @@ fn new_smallintmap_adapter[@K,
fn get(key: &K) -> V { ret smallintmap::get(map, key_idx(key)); }
fn find(key: &K) -> option::t[V] {
fn find(key: &K) -> option::t<V> {
ret smallintmap::find(map, key_idx(key));
}
fn remove(key: &K) -> option::t[V] { fail }
fn remove(key: &K) -> option::t<V> { fail }
fn rehash() { fail }
iter items() -> @{key: K, val: V} {
let idx = 0u;
for item: option::t[V] in map.v {
for item: option::t<V> in map.v {
alt item {
option::some(elt) {
let value = elt;