Lex a f-string start token.
(&mut self, quote: char)
| 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> { |
no test coverage detected