1
Fork 0

Reserve 'be' as a keyword

This commit is contained in:
Brian Anderson 2012-09-11 19:26:48 -07:00
parent ea01ee2e9e
commit 3d2a74a160
4 changed files with 41 additions and 0 deletions

View file

@ -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)