aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front/ast.rs
diff options
context:
space:
mode:
authorLindsey Kuper <[email protected]>2011-05-06 17:08:41 -0700
committerGraydon Hoare <[email protected]>2011-05-13 17:35:12 -0700
commit7c2979e26f23739b62fcda7500d4c5eac092c42c (patch)
tree64bd9f4fb3176e0d352d9770efb009c9eb8d0d27 /src/comp/front/ast.rs
parentAdd support for 'T' transition snapshots, which are identical to S snapshots ... (diff)
downloadrust-7c2979e26f23739b62fcda7500d4c5eac092c42c.tar.xz
rust-7c2979e26f23739b62fcda7500d4c5eac092c42c.zip
Starting on support for anonymous objects. Just syntax so far.
Diffstat (limited to 'src/comp/front/ast.rs')
-rw-r--r--src/comp/front/ast.rs20
1 files changed, 20 insertions, 0 deletions
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);