Skip to content

Commit

Permalink
More work on #2082, remove parser/lexer support for 'crust' and 'nati…
Browse files Browse the repository at this point in the history
…ve'.
  • Loading branch information
graydon committed Jul 3, 2012
1 parent be2c920 commit 3f59a4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
11 changes: 2 additions & 9 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ class parser {
fn get_id() -> node_id { next_node_id(self.sess) }

fn parse_ty_fn(purity: ast::purity) -> ty_ {
let proto = if self.eat_keyword("native") ||
self.eat_keyword("extern") {
let proto = if self.eat_keyword("extern") {
self.expect_keyword("fn");
ast::proto_bare
} else {
Expand Down Expand Up @@ -433,8 +432,7 @@ class parser {
self.parse_ty_fn(ast::unsafe_fn)
} else if self.is_keyword("fn") {
self.parse_ty_fn(ast::impure_fn)
} else if self.eat_keyword("native") ||
self.eat_keyword("extern") {
} else if self.eat_keyword("extern") {
self.expect_keyword("fn");
ty_fn(proto_bare, self.parse_ty_fn_decl(ast::impure_fn))
} else if self.token == token::MOD_SEP || is_ident(self.token) {
Expand Down Expand Up @@ -2457,13 +2455,8 @@ class parser {
} else {
self.parse_item_foreign_mod()
}
} else if self.eat_keyword("crust") {
self.expect_keyword("fn");
self.parse_item_fn(extern_fn)
} else if self.eat_keyword("mod") {
self.parse_item_mod()
} else if self.eat_keyword("native") {
self.parse_item_foreign_mod()
} else if self.eat_keyword("type") {
self.parse_item_type()
} else if self.eat_keyword("enum") {
Expand Down
4 changes: 2 additions & 2 deletions src/libsyntax/parse/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,14 @@ fn restricted_keyword_table() -> hashmap<str, ()> {
"alt",
"assert",
"break",
"check", "claim", "class", "const", "cont", "copy", "crust",
"check", "claim", "class", "const", "cont", "copy",
"do", "drop",
"else", "enum", "export", "extern",
"fail", "false", "fn", "for",
"if", "iface", "impl", "import",
"let", "log", "loop",
"mod", "mut",
"native", "new",
"new",
"pure", "ret",
"true", "trait", "type",
"unchecked", "unsafe",
Expand Down

0 comments on commit 3f59a4b

Please sign in to comment.