From 7568dd4564d417d6d03801934b0c9163d3566a8b Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 12 Sep 2012 14:51:38 -0700 Subject: Promote 'const', 'copy', 'fn' to strict keywords --- src/libsyntax/parse/parser.rs | 4 +++- src/libsyntax/parse/token.rs | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 1089431d810..c96cfdfe6bc 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2329,7 +2329,9 @@ impl parser { | ~"owned" => { self.obsolete(copy self.span, ObsoleteLowerCaseKindBounds); - None + // Bogus value, but doesn't matter, since + // is an error + Some(bound_send) } _ => None diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 7ad5c98b498..9786d2141f0 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -414,8 +414,7 @@ fn temporary_keyword_table() -> HashMap<~str, ()> { fn restricted_keyword_table() -> HashMap<~str, ()> { let words = str_hash(); let keys = ~[ - ~"const", ~"copy", - ~"fail", ~"fn", + ~"fail", ~"unsafe" ]; for keys.each |word| { @@ -430,9 +429,10 @@ fn strict_keyword_table() -> HashMap<~str, ()> { let keys = ~[ ~"as", ~"assert", ~"break", + ~"const", ~"copy", ~"do", ~"drop", ~"else", ~"enum", ~"export", ~"extern", - ~"false", ~"for", + ~"false", ~"fn", ~"for", ~"if", ~"impl", ~"let", ~"log", ~"loop", ~"match", ~"mod", ~"move", ~"mut", -- cgit 1.4.1-3-g733a5