aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2010-12-01 15:27:38 -0800
committerPatrick Walton <[email protected]>2010-12-01 15:27:38 -0800
commitfd600bad4666758088ec69a355a0dbd86bb11c22 (patch)
tree5d5d69c08aa4635575da7b825a19c13298167640 /src/comp/front
parentrustc: Typecheck tag constructors (diff)
downloadrust-fd600bad4666758088ec69a355a0dbd86bb11c22.tar.xz
rust-fd600bad4666758088ec69a355a0dbd86bb11c22.zip
rustc: Annotate variants with their types. This may be useful for trans!
Diffstat (limited to 'src/comp/front')
-rw-r--r--src/comp/front/ast.rs2
-rw-r--r--src/comp/front/parser.rs3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs
index 06e80d7b..4fbc4f01 100644
--- a/src/comp/front/ast.rs
+++ b/src/comp/front/ast.rs
@@ -183,7 +183,7 @@ tag mod_index_entry {
type _mod = rec(vec[@item] items,
hashmap[ident,mod_index_entry] index);
-type variant = rec(str name, vec[@ty] args, def_id id);
+type variant = rec(str name, vec[@ty] args, def_id id, ann ann);
type item = spanned[item_];
tag item_ {
diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs
index eeb279a7..ede8c637 100644
--- a/src/comp/front/parser.rs
+++ b/src/comp/front/parser.rs
@@ -1283,7 +1283,8 @@ impure fn parse_item_tag(parser p) -> @ast.item {
expect(p, token.SEMI);
auto id = p.next_def_id();
- variants += vec(rec(name=name, args=args, id=id));
+ variants += vec(rec(name=name, args=args, id=id,
+ ann=ast.ann_none));
}
case (token.RBRACE) { /* empty */ }
case (_) {