From 9c9c5c9054c2680a68c47f0bd9d80625b0906507 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 25 Aug 2011 18:26:29 -0700 Subject: [PATCH] Remove ast::identistr. Issue #855 --- src/comp/middle/resolve.rs | 6 +++--- src/comp/middle/trans_alt.rs | 2 +- src/comp/syntax/ast.rs | 1 - src/comp/syntax/ext/simplext.rs | 13 ++++++------- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/comp/middle/resolve.rs b/src/comp/middle/resolve.rs index f65449e7099..92ed4cfc196 100644 --- a/src/comp/middle/resolve.rs +++ b/src/comp/middle/resolve.rs @@ -102,7 +102,7 @@ tag mod_index_entry { mie_tag_variant(/* tag item */@ast::item, /* variant index */uint); } -type mod_index = hashmap>; +type mod_index = hashmap>; // A tuple of an imported def and the import stmt that brung it type glob_imp_def = {def: def, item: @ast::view_item}; @@ -1078,7 +1078,7 @@ fn lookup_in_mie(e: &env, mie: &mod_index_entry, ns: namespace) -> // Module indexing -fn add_to_index(index: &hashmap>, +fn add_to_index(index: &hashmap>, id: &ident, ent: &mod_index_entry) { alt index.find(id) { none. { index.insert(id, @@ -1195,7 +1195,7 @@ fn check_for_collisions(e: &@env, c: &ast::crate) { // Module indices make checking those relatively simple -- just check each // name for multiple entities in the same namespace. for each m: @{key: ast::node_id, val: @indexed_mod} in e.mod_map.items() { - for each name: @{key: identistr, val: list} in + for each name: @{key: ident, val: list} in m.val.index.items() { check_mod_name(*e, name.key, name.val); } diff --git a/src/comp/middle/trans_alt.rs b/src/comp/middle/trans_alt.rs index fdd2446cb1b..66c331dbab0 100644 --- a/src/comp/middle/trans_alt.rs +++ b/src/comp/middle/trans_alt.rs @@ -469,7 +469,7 @@ fn make_phi_bindings(bcx: &@block_ctxt, map: &[exit_node], ids: &ast_util::pat_id_map) -> bool { let our_block = bcx.llbb as uint; let success = true; - for each item: @{key: ast::identistr, val: ast::node_id} in ids.items() { + for each item: @{key: ast::ident, val: ast::node_id} in ids.items() { let llbbs = []; let vals = []; for ex: exit_node in map { diff --git a/src/comp/syntax/ast.rs b/src/comp/syntax/ast.rs index 4009ff2bd4e..edbc1f829fc 100644 --- a/src/comp/syntax/ast.rs +++ b/src/comp/syntax/ast.rs @@ -8,7 +8,6 @@ import codemap::filename; type spanned = {node: T, span: span}; type ident = istr; -type identistr = istr; // Functions may or may not have names. type fn_ident = option::t; diff --git a/src/comp/syntax/ext/simplext.rs b/src/comp/syntax/ext/simplext.rs index 94d814ae9c8..55f54c3057c 100644 --- a/src/comp/syntax/ext/simplext.rs +++ b/src/comp/syntax/ext/simplext.rs @@ -19,7 +19,6 @@ import fold::*; import ast::node_id; import ast_util::respan; import ast::ident; -import ast::identistr; import ast::path; import ast::ty; import ast::blk; @@ -157,9 +156,9 @@ fn compose_sels(s1: selector, s2: selector) -> selector { type binders = - {real_binders: hashmap, + {real_binders: hashmap, mutable literal_ast_matchers: [selector]}; -type bindings = hashmap>; +type bindings = hashmap>; fn acumm_bindings(_cx: &ext_ctxt, _b_dest: &bindings, _b_src: &bindings) { } @@ -191,7 +190,7 @@ fn use_selectors_to_bind(b: &binders, e: @expr) -> option::t { alt sel(match_expr(e)) { none. { ret none; } _ { } } } let never_mind: bool = false; - for each pair: @{key: identistr, + for each pair: @{key: ident, val: selector} in b.real_binders.items() { alt pair.val(match_expr(e)) { none. { never_mind = true; } @@ -265,9 +264,9 @@ fn follow_for_trans(cx: &ext_ctxt, mmaybe: &option::t>, /* helper for transcribe_exprs: what vars from `b` occur in `e`? */ iter free_vars(b: &bindings, e: @expr) -> ident { - let idents: hashmap = new_str_hash::<()>(); + let idents: hashmap = new_str_hash::<()>(); fn mark_ident(i: &ident, _fld: ast_fold, b: &bindings, - idents: &hashmap) -> ident { + idents: &hashmap) -> ident { if b.contains_key(i) { idents.insert(i, ()); } @@ -281,7 +280,7 @@ iter free_vars(b: &bindings, e: @expr) -> ident { let f = make_fold(f_pre); f.fold_expr(e); // ignore result dummy_out(f); - for each id: identistr in idents.keys() { put id; } + for each id: ident in idents.keys() { put id; } }