From 3f59a4bc64f46c5f44621327c697c5314b2f4358 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Tue, 3 Jul 2012 16:34:40 -0700 Subject: [PATCH] More work on #2082, remove parser/lexer support for 'crust' and 'native'. --- src/libsyntax/parse/parser.rs | 11 ++--------- src/libsyntax/parse/token.rs | 4 ++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 267bbda9b21..747ca07bee5 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -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 { @@ -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) { @@ -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") { diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index a2bd503ffca..4c573b45a1f 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -293,14 +293,14 @@ fn restricted_keyword_table() -> hashmap { "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",