Turn most contextual keywords into restricted keywords

This commit is contained in:
Brian Anderson 2012-09-09 16:53:47 -07:00
parent f53c2948aa
commit 528373b79b

View file

@ -382,12 +382,7 @@ fn keyword_table() -> hashmap<~str, ()> {
fn contextual_keyword_table() -> hashmap<~str, ()> { fn contextual_keyword_table() -> hashmap<~str, ()> {
let words = str_hash(); let words = str_hash();
let keys = ~[ let keys = ~[
~"as",
~"else",
~"move",
~"priv", ~"pub",
~"self", ~"static", ~"self", ~"static",
~"use"
]; ];
for keys.each |word| { for keys.each |word| {
words.insert(word, ()); words.insert(word, ());
@ -412,6 +407,7 @@ fn contextual_keyword_table() -> hashmap<~str, ()> {
fn restricted_keyword_table() -> hashmap<~str, ()> { fn restricted_keyword_table() -> hashmap<~str, ()> {
let words = str_hash(); let words = str_hash();
let keys = ~[ let keys = ~[
~"as",
~"assert", ~"assert",
~"break", ~"break",
~"const", ~"copy", ~"const", ~"copy",
@ -421,11 +417,11 @@ fn restricted_keyword_table() -> hashmap<~str, ()> {
~"if", ~"impl", ~"import", ~"if", ~"impl", ~"import",
~"let", ~"log", ~"loop", ~"let", ~"log", ~"loop",
~"match", ~"mod", ~"move", ~"mut", ~"match", ~"mod", ~"move", ~"mut",
~"pure", ~"priv", ~"pub", ~"pure",
~"ref", ~"return", ~"ref", ~"return",
~"struct", ~"struct",
~"true", ~"trait", ~"type", ~"true", ~"trait", ~"type",
~"unchecked", ~"unsafe", ~"unchecked", ~"unsafe", ~"use",
~"while" ~"while"
]; ];
for keys.each |word| { for keys.each |word| {