syntax: Enforce attribute grammar in the parser

This commit is contained in:
Vadim Petrochenkov
2018-08-12 20:15:59 +03:00
parent a5733050de
commit 097c40cf6e
20 changed files with 128 additions and 55 deletions

View File

@@ -825,7 +825,7 @@ impl<'a> Parser<'a> {
///
/// This method will automatically add `tok` to `expected_tokens` if `tok` is not
/// encountered.
fn check(&mut self, tok: &token::Token) -> bool {
crate fn check(&mut self, tok: &token::Token) -> bool {
let is_present = self.token == *tok;
if !is_present { self.expected_tokens.push(TokenType::Token(tok.clone())); }
is_present