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

Method consume_identifier

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

Source from the content-addressed store, hash-verified

442 }
443
444 fn consume_identifier(&mut self) -> Token {
445 let start_index = self.index;
446 while self.is_current_char_func(|c| c == '_' || c.is_alphanumeric()) {
447 self.advance();
448 }
449
450 // Identifier is being case-insensitive by default, convert to lowercase to be easy to compare and lookup
451 let literal = &self.content[start_index..self.index];
452 let mut string: String = literal.iter().collect();
453 string = string.to_lowercase();
454
455 let kind = GITQL_RESERVED_KEYWORDS
456 .get(string.as_str())
457 .cloned()
458 .unwrap_or(TokenKind::Symbol(string));
459 Token::new(kind, self.current_source_location())
460 }
461
462 fn consume_backticks_identifier(&mut self) -> Result<Token, Box<Diagnostic>> {
463 let start_index = self.index;

Callers 1

tokenize_charactersMethod · 0.80

Calls 3

is_current_char_funcMethod · 0.80
advanceMethod · 0.80

Tested by

no test coverage detected