libsyntax: Parse self types in methods

This commit is contained in:
Patrick Walton
2012-07-30 16:33:02 -07:00
parent 290f079474
commit 51a06c15da
4 changed files with 174 additions and 17 deletions

View File

@@ -117,12 +117,16 @@ impl parser_common of parser_common for parser {
}
}
fn token_is_word(word: ~str, ++tok: token::token) -> bool {
alt tok {
token::IDENT(sid, false) => { str::eq(word, *self.get_str(sid)) }
_ => { false }
}
}
fn token_is_keyword(word: ~str, ++tok: token::token) -> bool {
self.require_keyword(word);
alt tok {
token::IDENT(sid, false) { str::eq(word, *self.get_str(sid)) }
_ { false }
}
self.token_is_word(word, tok)
}
fn is_keyword(word: ~str) -> bool {