(&mut self)
| 485 | } |
| 486 | |
| 487 | fn expect_ident(&mut self) -> Result<String, String> { |
| 488 | match std::mem::replace(&mut self.current, Token::Eof) { |
| 489 | Token::Ident(v) => { |
| 490 | self.advance(); |
| 491 | Ok(v.to_string()) |
| 492 | } |
| 493 | other => Err(format!("expected identifier, got {other:?}")), |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | fn advance(&mut self) { |
| 498 | self.current = self.lexer.next_token(); |
no test coverage detected