MCPcopy Create free account
hub / github.com/AmrDeveloper/GQL / consume_string_in_single_quotes

Method consume_string_in_single_quotes

crates/gitql-parser/src/tokenizer.rs:648–662  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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('"')?;

Callers 1

tokenize_charactersMethod · 0.80

Calls 6

as_boxedMethod · 0.80
with_locationMethod · 0.80
add_helpMethod · 0.80
advanceMethod · 0.80

Tested by

no test coverage detected