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

Method consume_string_in_double_quotes

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

Source from the content-addressed store, hash-verified

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

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