diff options
| author | Rafael Ávila de Espíndola <[email protected]> | 2011-01-04 17:58:10 -0500 |
|---|---|---|
| committer | Rafael Ávila de Espíndola <[email protected]> | 2011-01-04 17:58:10 -0500 |
| commit | 7c8f99fdc1be0ed80095af160fffae2995cda83f (patch) | |
| tree | efd74af4844e715c0a6797833db7a38183f1dc60 /src/comp/front/parser.rs | |
| parent | Add support for looking up a name introduced by a 'use'. (diff) | |
| download | rust-7c8f99fdc1be0ed80095af160fffae2995cda83f.tar.xz rust-7c8f99fdc1be0ed80095af160fffae2995cda83f.zip | |
Add names from imports to the namespace.
Diffstat (limited to 'src/comp/front/parser.rs')
| -rw-r--r-- | src/comp/front/parser.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index 8c3db0e1..f71fae61 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -1,4 +1,5 @@ import std._io; +import std._vec; import std.option; import std.option.some; import std.option.none; @@ -1751,10 +1752,12 @@ impure fn parse_view(parser p, ast.mod_index index) -> vec[@ast.view_item] { items += vec(item); alt (item.node) { case(ast.view_item_use(?id, _, _)) { - index.insert(id, ast.mie_use(u)); + index.insert(id, ast.mie_view_item(u)); } case(ast.view_item_import(?ids,_)) { - // FIXME + auto len = _vec.len[ast.ident](ids); + auto last_id = ids.(len - 1u); + index.insert(last_id, ast.mie_view_item(u)); } } u = u + 1u; |