Match and consume a specific identifier string. Used for pseudo-keywords like "stack_slot" that only appear in certain contexts.
(&mut self, want: &'static str, err_msg: &str)
| 552 | // Match and consume a specific identifier string. |
| 553 | // Used for pseudo-keywords like "stack_slot" that only appear in certain contexts. |
| 554 | fn match_identifier(&mut self, want: &'static str, err_msg: &str) -> ParseResult<Token<'a>> { |
| 555 | if self.token() == Some(Token::Identifier(want)) { |
| 556 | Ok(self.consume()) |
| 557 | } else { |
| 558 | err!(self.loc, err_msg) |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | // Match and consume a type. |
| 563 | fn match_type(&mut self, err_msg: &str) -> ParseResult<Type> { |
no test coverage detected