MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / diag_at_peek

Method diag_at_peek

compiler/src/modules/parser/mod.rs:305–313  ·  view source on GitHub ↗

Non-syncing diagnostic at peek; used when flow must continue (e.g. missing class name). */

(&mut self, msg: &str)

Source from the content-addressed store, hash-verified

303
304 /* Non-syncing diagnostic at peek; used when flow must continue (e.g. missing class name). */
305 pub(super) fn diag_at_peek(&mut self, msg: &str) {
306 let n = self.source.len();
307 let (start, end) = match self.tokens.peek() {
308 Some(t) if t.line > self.last_line && self.last_end > 0 => (self.last_end, self.last_end),
309 Some(t) => (t.start, t.end),
310 None => (n, n),
311 };
312 self.errors.push(Diagnostic { start, end, msg: msg.to_string() });
313 }
314
315 /* Diagnostic at next token + panic-mode sync to next statement boundary. */
316 pub(super) fn error(&mut self, msg: &str) {

Callers 3

class_def_withMethod · 0.80
func_def_innerMethod · 0.80
parse_paramsMethod · 0.80

Calls 3

pushMethod · 0.80
lenMethod · 0.45
peekMethod · 0.45

Tested by

no test coverage detected