diff options
| author | Rafael Ávila de Espíndola <[email protected]> | 2011-03-11 17:10:11 -0500 |
|---|---|---|
| committer | Rafael Ávila de Espíndola <[email protected]> | 2011-03-11 17:12:25 -0500 |
| commit | 28d51e3fd2cccdb9fefab71b476fd868a2363ac9 (patch) | |
| tree | 55cffdf76ee450919e60c24ec74ae12ee0b13dfd /src/comp/front/ast.rs | |
| parent | rustc: Un-XFAIL test/run-pass/foreach-simple-outer-slot.rs (diff) | |
| download | rust-28d51e3fd2cccdb9fefab71b476fd868a2363ac9.tar.xz rust-28d51e3fd2cccdb9fefab71b476fd868a2363ac9.zip | |
Add support for indexing tags in blocks.
Diffstat (limited to 'src/comp/front/ast.rs')
| -rw-r--r-- | src/comp/front/ast.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index 05daf5ee..c17eddee 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -66,9 +66,15 @@ type meta_item = spanned[meta_item_]; type meta_item_ = rec(ident name, str value); type block = spanned[block_]; +type block_index = hashmap[ident, block_index_entry]; +tag block_index_entry { + bie_item(@item); + bie_local(@local); + bie_tag_variant(@item /* tag item */, uint /* variant index */); +} type block_ = rec(vec[@stmt] stmts, option.t[@expr] expr, - hashmap[ident,uint] index); + hashmap[ident,block_index_entry] index); type variant_def = tup(def_id /* tag */, def_id /* variant */); |