(&mut self, token: Token<'_>, message: &str)
| 24 | } |
| 25 | |
| 26 | pub fn error_at(&mut self, token: Token<'_>, message: &str) { |
| 27 | if self.panic_mode { |
| 28 | return; |
| 29 | } |
| 30 | self.panic_mode = true; |
| 31 | eprint!("[line {}] Error", token.line); |
| 32 | if token.kind == TokenType::Eof { |
| 33 | eprint!(" at end"); |
| 34 | } else if token.kind == TokenType::Invalid { |
| 35 | // Do nothing. |
| 36 | } else { |
| 37 | eprint!(" at '{}'", token.lexeme); |
| 38 | } |
| 39 | eprintln!(": {message}"); |
| 40 | self.had_error = true; |
| 41 | } |
| 42 | } |
no outgoing calls
no test coverage detected