MCPcopy Create free account
hub / github.com/LaBatata101/sith-language-server / next_token

Method next_token

crates/sith_python_parser/src/lexer.rs:146–156  ·  view source on GitHub ↗

Lex the next token.

(&mut self)

Source from the content-addressed store, hash-verified

144
145 /// Lex the next token.
146 pub fn next_token(&mut self) -> TokenKind {
147 self.cursor.start_token();
148 self.current_value = TokenValue::None;
149 self.current_flags = TokenFlags::empty();
150 self.current_kind = self.lex_token();
151 // For `Unknown` token, the `push_error` method updates the current range.
152 if !matches!(self.current_kind, TokenKind::Unknown) {
153 self.current_range = self.token_range();
154 }
155 self.current_kind
156 }
157
158 fn lex_token(&mut self) -> TokenKind {
159 if let Some(fstring) = self.fstrings.current() {

Callers 5

re_lex_logical_tokenMethod · 0.80
lexFunction · 0.80
do_bumpMethod · 0.80
next_non_trivia_tokenMethod · 0.80
benchmark_lexerFunction · 0.80

Calls 4

emptyFunction · 0.85
start_tokenMethod · 0.80
lex_tokenMethod · 0.80
token_rangeMethod · 0.80

Tested by

no test coverage detected