check if the token is a lifetime before parsing

This commit is contained in:
rleungx
2018-05-03 19:09:34 +08:00
parent 698b956a9f
commit 390c3cee6a
3 changed files with 28 additions and 2 deletions

View File

@@ -2042,7 +2042,7 @@ impl<'a> Parser<'a> {
})
}
fn check_lifetime(&mut self) -> bool {
pub fn check_lifetime(&mut self) -> bool {
self.expected_tokens.push(TokenType::Lifetime);
self.token.is_lifetime()
}