Whether current token is synchronize keyword, this mainly used in `synchronize()`. When reporing error and encounter a new synchronized keyword, we should keep going to parse the next declaration.
(&self)
| 165 | // When reporing error and encounter a new synchronized keyword, |
| 166 | // we should keep going to parse the next declaration. |
| 167 | pub fn is_synchronize_keyword(&self) -> bool { |
| 168 | matches!( |
| 169 | self.kind, |
| 170 | TokenType::Agent |
| 171 | | TokenType::AI |
| 172 | | TokenType::Class |
| 173 | | TokenType::Const |
| 174 | | TokenType::Enum |
| 175 | | TokenType::Fn |
| 176 | | TokenType::For |
| 177 | | TokenType::If |
| 178 | | TokenType::Let |
| 179 | | TokenType::Match |
| 180 | | TokenType::Pub |
| 181 | | TokenType::Raise |
| 182 | | TokenType::Return |
| 183 | | TokenType::Use |
| 184 | | TokenType::While |
| 185 | ) |
| 186 | } |
| 187 | |
| 188 | /// Check if the token could start as an expression. |
| 189 | pub fn is_expr_start(&self) -> bool { |