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

Method lex_fstring_start

crates/sith_python_parser/src/lexer.rs:731–747  ·  view source on GitHub ↗

Lex a f-string start token.

(&mut self, quote: char)

Source from the content-addressed store, hash-verified

729
730 /// Lex a f-string start token.
731 fn lex_fstring_start(&mut self, quote: char) -> TokenKind {
732 #[cfg(debug_assertions)]
733 debug_assert_eq!(self.cursor.previous(), quote);
734
735 if quote == '"' {
736 self.current_flags |= TokenFlags::DOUBLE_QUOTES;
737 }
738
739 if self.cursor.eat_char2(quote, quote) {
740 self.current_flags |= TokenFlags::TRIPLE_QUOTED_STRING;
741 }
742
743 self.fstrings
744 .push(FStringContext::new(self.current_flags, self.nesting));
745
746 TokenKind::FStringStart
747 }
748
749 /// Lex a f-string middle or end token.
750 fn lex_fstring_middle_or_end(&mut self) -> Option<TokenKind> {

Callers 1

lex_identifierMethod · 0.80

Calls 2

eat_char2Method · 0.80
pushMethod · 0.45

Tested by

no test coverage detected