diff options
| author | Rafael Ávila de Espíndola <[email protected]> | 2011-01-28 11:54:59 -0500 |
|---|---|---|
| committer | Rafael Ávila de Espíndola <[email protected]> | 2011-01-28 11:54:59 -0500 |
| commit | 3cac20dae3272728282466467cb0193d7dbbf00c (patch) | |
| tree | a257f43c91b257ce34eb8eff0d4839af8787075f /src/comp/front/ast.rs | |
| parent | Add helper function for derived type descriptors. (diff) | |
| download | rust-3cac20dae3272728282466467cb0193d7dbbf00c.tar.xz rust-3cac20dae3272728282466467cb0193d7dbbf00c.zip | |
Correctly handle "import foo = bar.zed;".
Diffstat (limited to 'src/comp/front/ast.rs')
| -rw-r--r-- | src/comp/front/ast.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index 2ae4c907..70da87dd 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -231,7 +231,7 @@ type variant = rec(str name, vec[variant_arg] args, def_id id, ann ann); type view_item = spanned[view_item_]; tag view_item_ { view_item_use(ident, vec[@meta_item], def_id); - view_item_import(vec[ident], def_id, option.t[def]); + view_item_import(ident, vec[ident], def_id, option.t[def]); } type item = spanned[item_]; @@ -249,10 +249,8 @@ fn index_view_item(mod_index index, @view_item it) { case(ast.view_item_use(?id, _, _)) { index.insert(id, ast.mie_view_item(it)); } - case(ast.view_item_import(?ids,_,_)) { - auto len = _vec.len[ast.ident](ids); - auto last_id = ids.(len - 1u); - index.insert(last_id, ast.mie_view_item(it)); + case(ast.view_item_import(?def_ident,_,_,_)) { + index.insert(def_ident, ast.mie_view_item(it)); } } } |