From 7c2979e26f23739b62fcda7500d4c5eac092c42c Mon Sep 17 00:00:00 2001 From: Lindsey Kuper Date: Fri, 6 May 2011 17:08:41 -0700 Subject: Starting on support for anonymous objects. Just syntax so far. --- src/comp/front/ast.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/comp/front/ast.rs') diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index 5e5185bf..51977b5f 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -296,6 +296,7 @@ tag expr_ { expr_check(@expr, ann); expr_port(ann); expr_chan(@expr, ann); + expr_anon_obj(anon_obj, vec[ty_param], obj_def_ids, ann); } type lit = spanned[lit_]; @@ -371,6 +372,25 @@ type _obj = rec(vec[obj_field] fields, vec[@method] methods, option::t[@method] dtor); + +// Hmm. An anon_obj might extend an existing object, in which case it'll +// probably add fields and methods. +type anon_obj = rec(option.t[vec[obj_field]] fields, + vec[@method] methods, + option.t[ident] with_obj); + +tag mod_index_entry { + mie_view_item(@view_item); + mie_item(@item); + mie_tag_variant(@item /* tag item */, uint /* variant index */); +} + +tag native_mod_index_entry { + nmie_view_item(@view_item); + nmie_item(@native_item); +} + +type mod_index = hashmap[ident,mod_index_entry]; type _mod = rec(vec[@view_item] view_items, vec[@item] items); -- cgit v1.2.3