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

Method bump

crates/ruff_python_parser/src/token_source.rs:162–166  ·  view source on GitHub ↗

Bumps the token source to the next non-trivia token. It pushes the given kind to the token vector with the current token range.

(&mut self, kind: TokenKind)

Source from the content-addressed store, hash-verified

160 ///
161 /// It pushes the given kind to the token vector with the current token range.
162 pub(crate) fn bump(&mut self, kind: TokenKind) {
163 self.tokens
164 .push(Token::new(kind, self.current_range(), self.current_flags()));
165 self.do_bump();
166 }
167
168 /// Bumps the token source to the next non-trivia token without adding the current token to the
169 /// token vector. It does add the trivia tokens to the token vector.

Callers 10

lex_tokenMethod · 0.45
eat_indentationMethod · 0.45
skip_whitespaceMethod · 0.45
lex_identifierMethod · 0.45
lex_stringMethod · 0.45
lex_decimal_numberMethod · 0.45
radix_runMethod · 0.45
re_lex_logical_tokenMethod · 0.45

Calls 4

pushMethod · 0.45
current_rangeMethod · 0.45
current_flagsMethod · 0.45
do_bumpMethod · 0.45

Tested by

no test coverage detected