about summary refs log tree commit diff
path: root/src/comp/syntax/parse/parser.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-01-10 15:29:50 -0800
committerPatrick Walton <pcwalton@mimiga.net>2012-01-10 15:32:39 -0800
commitffdb7f97f8027ed18348f1b5069a000c79a1b0ca (patch)
treec5557fbe673e40dd69a581ef852a1afe07988beb /src/comp/syntax/parse/parser.rs
parent0fba2d02559e16c7b243aff60bb5c2cbeacf0e58 (diff)
downloadrust-ffdb7f97f8027ed18348f1b5069a000c79a1b0ca.tar.gz
rust-ffdb7f97f8027ed18348f1b5069a000c79a1b0ca.zip
rustc: Accept "enum" in addition to "tag"
Diffstat (limited to 'src/comp/syntax/parse/parser.rs')
-rw-r--r--src/comp/syntax/parse/parser.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index 2025d8312c4..ca14bf6e870 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -170,7 +170,8 @@ fn bad_expr_word_table() -> hashmap<str, ()> {
                  "cont", "ret", "be", "fail", "type", "resource", "check",
                  "assert", "claim", "native", "fn", "pure",
                  "unsafe", "block", "import", "export", "let", "const",
-                 "log", "tag", "obj", "copy", "sendfn", "impl", "iface"] {
+                 "log", "tag", "obj", "copy", "sendfn", "impl", "iface",
+                 "enum"] {
         words.insert(word, ());
     }
     words
@@ -2148,7 +2149,7 @@ fn parse_item(p: parser, attrs: [ast::attribute]) -> option::t<@ast::item> {
         ret some(parse_item_native_mod(p, attrs));
     } if eat_word(p, "type") {
         ret some(parse_item_type(p, attrs));
-    } else if eat_word(p, "tag") {
+    } else if eat_word(p, "tag") || eat_word(p, "enum") {
         ret some(parse_item_tag(p, attrs));
     } else if is_word(p, "obj") && p.look_ahead(1u) != token::LPAREN {
         p.bump();