(&mut self)
| 662 | } |
| 663 | |
| 664 | fn consume_string_in_double_quotes(&mut self) -> Result<Token, Box<Diagnostic>> { |
| 665 | let buffer = self.consume_string_with_around('"')?; |
| 666 | |
| 667 | if self.index >= self.content_len { |
| 668 | return Err(Diagnostic::error("Unterminated double quote string") |
| 669 | .add_help("Add \" at the end of the String literal") |
| 670 | .with_location(self.current_source_location()) |
| 671 | .as_boxed()); |
| 672 | } |
| 673 | |
| 674 | // Consume `"` |
| 675 | self.advance(); |
| 676 | let location = self.current_source_location(); |
| 677 | Ok(Token::new(TokenKind::String(buffer), location)) |
| 678 | } |
| 679 | |
| 680 | fn consume_string_with_around(&mut self, around: char) -> Result<String, Box<Diagnostic>> { |
| 681 | // Consume Around start |
no test coverage detected