Reserve 'be' as a keyword
This commit is contained in:
parent
ea01ee2e9e
commit
3d2a74a160
4 changed files with 41 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue