rustc: Accept "enum" in addition to "tag"
This commit is contained in:
parent
0fba2d0255
commit
ffdb7f97f8
2 changed files with 5 additions and 4 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -410,8 +410,8 @@ fn print_item(s: ps, &&item: @ast::item) {
|
|||
vec::len(variants[0].node.args) == 1u;
|
||||
if newtype {
|
||||
ibox(s, indent_unit);
|
||||
word_space(s, "tag");
|
||||
} else { head(s, "tag"); }
|
||||
word_space(s, "enum");
|
||||
} else { head(s, "enum"); }
|
||||
word(s.s, item.ident);
|
||||
print_type_params(s, params);
|
||||
space(s.s);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue