Routes `}` to f-string body resume or plain Rbrace based on nesting depth. */
(&mut self, start: usize)
| 322 | |
| 323 | /* Routes `}` to f-string body resume or plain Rbrace based on nesting depth. */ |
| 324 | fn close_brace(&mut self, start: usize) { |
| 325 | let end = start + 1; |
| 326 | if let Some(&(_, _, _, saved_nesting)) = self.fstring_stack.last() { |
| 327 | if self.nesting > saved_nesting { |
| 328 | self.nesting -= 1; |
| 329 | } else { |
| 330 | let (quote, triple, _, _) = self.fstring_stack.pop().unwrap(); |
| 331 | self.pos = end; |
| 332 | self.scan_fstring_body(quote, triple, end); |
| 333 | self.pending.push((TokenType::Rbrace, self.line, start, end)); |
| 334 | // `pos` already advanced by scan_fstring_body. |
| 335 | return; |
| 336 | } |
| 337 | } else { |
| 338 | self.nesting = self.nesting.saturating_sub(1); |
| 339 | } |
| 340 | self.pending.push((TokenType::Rbrace, self.line, start, end)); |
| 341 | self.pos = end; |
| 342 | } |
| 343 | |
| 344 | /* Main dispatch: drains pending queue, then routes each byte via BYTE_CLASS / SINGLE_TOK lookups. */ |
| 345 | pub fn next_token(&mut self) -> Option<(TokenType, usize, usize, usize)> { |
no test coverage detected