Diagnostic at next token + panic-mode sync to next statement boundary. */
(&mut self, msg: &str)
| 314 | |
| 315 | /* Diagnostic at next token + panic-mode sync to next statement boundary. */ |
| 316 | pub(super) fn error(&mut self, msg: &str) { |
| 317 | let n = self.source.len(); |
| 318 | let (start, end) = self.tokens.peek().map(|t| (t.start, t.end)).unwrap_or((n, n)); |
| 319 | self.error_at(start, end, msg); |
| 320 | } |
| 321 | |
| 322 | /* Diagnostic at caller span + panic-mode sync; stops at statement boundary or bracket close. */ |
| 323 | pub(super) fn error_at(&mut self, start: usize, end: usize, msg: &str) { |
no test coverage detected