about summary refs log tree commit diff
path: root/src/libsyntax/parse/token.rs
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-09-11 19:26:48 -0700
committerBrian Anderson <banderson@mozilla.com>2012-09-11 19:26:48 -0700
commit3d2a74a160c5772efccda711e60c173077099ef2 (patch)
tree232a101ea013a8ead9633bd9a83c8a6e9c62798a /src/libsyntax/parse/token.rs
parentea01ee2e9e161a7028b98848c071e5fe9c30c7f7 (diff)
Reserve 'be' as a keyword
Diffstat (limited to 'src/libsyntax/parse/token.rs')
-rw-r--r--src/libsyntax/parse/token.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index aac36040cf0..3e5abe557e2 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -379,6 +379,9 @@ fn keyword_table() -> HashMap<~str, ()> {
     for strict_keyword_table().each_key |word| {
         keywords.insert(word, ());
     }
+    for reserved_keyword_table().each_key |word| {
+        keywords.insert(word, ());
+    }
     keywords
 }
 
@@ -447,6 +450,17 @@ fn strict_keyword_table() -> HashMap<~str, ()> {
     words
 }
 
+fn reserved_keyword_table() -> HashMap<~str, ()> {
+    let words = str_hash();
+    let keys = ~[
+        ~"be"
+    ];
+    for keys.each |word| {
+        words.insert(word, ());
+    }
+    words
+}
+
 impl binop : cmp::Eq {
     pure fn eq(&&other: binop) -> bool {
         (self as uint) == (other as uint)