(&mut self)
| 646 | } |
| 647 | |
| 648 | fn consume_string_in_single_quotes(&mut self) -> Result<Token, Box<Diagnostic>> { |
| 649 | let buffer = self.consume_string_with_around('\'')?; |
| 650 | |
| 651 | if self.index >= self.content_len { |
| 652 | return Err(Diagnostic::error("Unterminated single quote string") |
| 653 | .add_help("Add \' at the end of the String literal") |
| 654 | .with_location(self.current_source_location()) |
| 655 | .as_boxed()); |
| 656 | } |
| 657 | |
| 658 | // Consume `'` |
| 659 | self.advance(); |
| 660 | let location = self.current_source_location(); |
| 661 | Ok(Token::new(TokenKind::String(buffer), location)) |
| 662 | } |
| 663 | |
| 664 | fn consume_string_in_double_quotes(&mut self) -> Result<Token, Box<Diagnostic>> { |
| 665 | let buffer = self.consume_string_with_around('"')?; |
no test coverage detected