MCPcopy Create free account
hub / github.com/astral-sh/ruff / push_error

Method push_error

crates/ruff_python_parser/src/lexer.rs:133–137  ·  view source on GitHub ↗

Helper function to push the given error, updating the current range with the error location and return the [`TokenKind::Unknown`] token.

(&mut self, error: LexicalError)

Source from the content-addressed store, hash-verified

131 /// Helper function to push the given error, updating the current range with the error location
132 /// and return the [`TokenKind::Unknown`] token.
133 fn push_error(&mut self, error: LexicalError) -> TokenKind {
134 self.current_range = error.location();
135 self.errors.push(error);
136 TokenKind::Unknown
137 }
138
139 /// Lex the next token.
140 pub fn next_token(&mut self) -> TokenKind {

Callers 9

lex_tokenMethod · 0.80
eat_indentationMethod · 0.80
handle_indentationMethod · 0.80
lex_stringMethod · 0.80
lex_number_radixMethod · 0.80
lex_decimal_numberMethod · 0.80
consume_endMethod · 0.80

Calls 2

locationMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected