summary refs log tree commit diff
path: root/src/libsyntax/parse/token.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax/parse/token.rs')
-rw-r--r--src/libsyntax/parse/token.rs23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index aa2c9ab3a5e..5c719af41cd 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -362,10 +362,11 @@ fn mk_fake_ident_interner() -> ident_interner {
 /**
  * All the valid words that have meaning in the Rust language.
  *
- * Rust keywords are either 'contextual' or 'restricted'. Contextual
- * keywords may be used as identifiers because their appearance in
- * the grammar is unambiguous. Restricted keywords may not appear
- * in positions that might otherwise contain _value identifiers_.
+ * Rust keywords are either 'contextual', 'restricted', or 'strict, Contextual
+ * keywords may be used as identifiers because their appearance in the grammar
+ * is unambiguous. Restricted keywords may not appear in positions that might
+ * otherwise contain _value identifiers_.  Strict keywords may not appear as
+ * identifiers.
  */
 fn keyword_table() -> hashmap<~str, ()> {
     let keywords = str_hash();
@@ -375,6 +376,9 @@ fn keyword_table() -> hashmap<~str, ()> {
     for restricted_keyword_table().each_key |word| {
         keywords.insert(word, ());
     }
+    for strict_keyword_table().each_key |word| {
+        keywords.insert(word, ());
+    }
     keywords
 }
 
@@ -430,6 +434,17 @@ fn restricted_keyword_table() -> hashmap<~str, ()> {
     words
 }
 
+/// Full keywords. May not appear anywhere else.
+fn strict_keyword_table() -> hashmap<~str, ()> {
+    let words = str_hash();
+    let keys = ~[
+    ];
+    for keys.each |word| {
+        words.insert(word, ());
+    }
+    words
+}
+
 impl binop : cmp::Eq {
     pure fn eq(&&other: binop) -> bool {
         (self as uint) == (other as uint)