(&mut self)
| 3409 | } |
| 3410 | |
| 3411 | fn parse_fstring_middle(&mut self) -> Result<Expression, ParsingError> { |
| 3412 | let node = self.start_node(); |
| 3413 | match self.cur_kind() { |
| 3414 | Kind::FStringMiddle => { |
| 3415 | let val = self.cur_token().as_str(self.source); |
| 3416 | self.bump(Kind::FStringMiddle); |
| 3417 | Ok(Expression::Constant(Box::new(Constant { |
| 3418 | node: self.finish_node(node), |
| 3419 | value: ConstantValue::Str(QuoteType::from(val)), |
| 3420 | }))) |
| 3421 | } |
| 3422 | Kind::LeftBracket => self.parse_fstring_replacement_field(), |
| 3423 | _ => { |
| 3424 | panic!("kind is {}", self.cur_token().kind); |
| 3425 | } |
| 3426 | } |
| 3427 | } |
| 3428 | |
| 3429 | pub fn to_row_col(&self, start: u32, end: u32) -> (u32, u32, u32, u32) { |
| 3430 | get_row_col_position(start, end, &self.lexer.line_starts) |
no test coverage detected