From e9c12ab1d019b42e5427e31bfa49f1f799e84165 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Mon, 9 May 2011 12:40:09 +0200 Subject: Rewrite comp/middle/resolve.rs * Cleans up the algorithm * Move first pass to walk (second still folds) * Support part of a type/value namespace split (crate metadata and module indices still need to be taught about this) * Remove a few blatant inefficiencies (import tables being recreated for every lookup, most importantly) --- src/comp/front/creader.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/comp/front/creader.rs') diff --git a/src/comp/front/creader.rs b/src/comp/front/creader.rs index 832ef131..dd913b53 100644 --- a/src/comp/front/creader.rs +++ b/src/comp/front/creader.rs @@ -635,14 +635,8 @@ fn list_crate_metadata(vec[u8] bytes, IO.writer out) { fn describe_def(&EBML.doc items, ast.def_id id) -> str { if (id._0 != 0) {ret "external";} - alt (maybe_find_item(id._1 as int, items)) { - case (Option.some[EBML.doc](?item)) { - ret item_kind_to_str(item_kind(item)); - } - case (Option.none[EBML.doc]) { - ret "??"; // Native modules don't seem to get item entries. - } - } + auto item = find_item(id._1, items); + ret item_kind_to_str(item_kind(item)); } fn item_kind_to_str(u8 kind) -> str { -- cgit v1.2.3