libsyntax: Remove the restricted keyword concept
This commit is contained in:
@@ -37,9 +37,6 @@ trait parser_common {
|
||||
fn is_any_keyword(tok: token::token) -> bool;
|
||||
fn eat_keyword(word: ~str) -> bool;
|
||||
fn expect_keyword(word: ~str);
|
||||
fn is_restricted_keyword(word: ~str) -> bool;
|
||||
fn check_restricted_keywords();
|
||||
fn check_restricted_keywords_(w: ~str);
|
||||
fn expect_gt();
|
||||
fn parse_seq_to_before_gt<T: Copy>(sep: Option<token::token>,
|
||||
f: fn(parser) -> T) -> ~[T];
|
||||
@@ -104,7 +101,6 @@ impl parser: parser_common {
|
||||
}
|
||||
|
||||
fn parse_value_ident() -> ast::ident {
|
||||
self.check_restricted_keywords();
|
||||
return self.parse_ident();
|
||||
}
|
||||
|
||||
@@ -165,26 +161,6 @@ impl parser: parser_common {
|
||||
}
|
||||
}
|
||||
|
||||
fn is_restricted_keyword(word: ~str) -> bool {
|
||||
self.restricted_keywords.contains_key_ref(&word)
|
||||
}
|
||||
|
||||
fn check_restricted_keywords() {
|
||||
match self.token {
|
||||
token::IDENT(_, false) => {
|
||||
let w = token_to_str(self.reader, self.token);
|
||||
self.check_restricted_keywords_(w);
|
||||
}
|
||||
_ => ()
|
||||
}
|
||||
}
|
||||
|
||||
fn check_restricted_keywords_(w: ~str) {
|
||||
if self.is_restricted_keyword(w) {
|
||||
self.fatal(~"found `" + w + ~"` in restricted position");
|
||||
}
|
||||
}
|
||||
|
||||
fn is_strict_keyword(word: ~str) -> bool {
|
||||
self.strict_keywords.contains_key_ref(&word)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user