Port the compiler to foo<T> decl syntax.

This commit is contained in:
Erick Tryzelaar 2011-08-12 06:36:51 -07:00 committed by Graydon Hoare
parent 4c9049c50c
commit 4abc471390
20 changed files with 77 additions and 77 deletions

View file

@ -36,7 +36,7 @@ fn encode_def_id(ebml_w: &ebml::writer, id: &def_id) {
ebml::end_tag(ebml_w);
}
type entry[T] = {val: T, pos: uint};
type entry<T> = {val: T, pos: uint};
fn encode_tag_variant_paths(ebml_w: &ebml::writer, variants: &[variant],
path: &[str], index: &mutable [entry<str>]) {
@ -392,7 +392,7 @@ fn encode_info_for_items(ecx: &@encode_ctxt, ebml_w: &ebml::writer) ->
// Path and definition ID indexing
fn create_index[T](index: &[entry<T>], hash_fn: fn(&T) -> uint ) ->
fn create_index<T>(index: &[entry<T>], hash_fn: fn(&T) -> uint ) ->
[@[entry<T>]] {
let buckets: [@mutable [entry<T>]] = ~[];
for each i: uint in uint::range(0u, 256u) { buckets += ~[@mutable ~[]]; }
@ -408,7 +408,7 @@ fn create_index[T](index: &[entry<T>], hash_fn: fn(&T) -> uint ) ->
ret buckets_frozen;
}
fn encode_index[T](ebml_w: &ebml::writer, buckets: &[@[entry<T>]],
fn encode_index<T>(ebml_w: &ebml::writer, buckets: &[@[entry<T>]],
write_fn: fn(&io::writer, &T) ) {
let writer = io::new_writer_(ebml_w.writer);
ebml::start_tag(ebml_w, tag_index);

View file

@ -115,7 +115,7 @@ fn parse_path(st: @pstate, sd: str_def) -> ast::path {
fail "parse_path: ill-formed path";
}
type arg_parser[T] = fn(@pstate, str_def) -> ast::constr_arg_general_<T> ;
type arg_parser<T> = fn(@pstate, str_def) -> ast::constr_arg_general_<T> ;
fn parse_constr_arg(st: @pstate, sd: str_def) -> ast::fn_constr_arg {
alt peek(st) as char {
@ -150,7 +150,7 @@ fn parse_ty_constr_arg(st: @pstate, sd: str_def) ->
}
}
fn parse_constr[@T](st: @pstate, sd: str_def, pser: arg_parser<T>) ->
fn parse_constr<@T>(st: @pstate, sd: str_def, pser: arg_parser<T>) ->
@ty::constr_general<T> {
let sp = ast::dummy_sp(); // FIXME: use a real span
let args: [@sp_constr_arg<T>] = ~[];