MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / error_at

Method error_at

aiscript-lexer/src/error_reporter.rs:26–41  ·  view source on GitHub ↗
(&mut self, token: Token<'_>, message: &str)

Source from the content-addressed store, hash-verified

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}

Callers 2

error_at_currentMethod · 0.45
errorMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected