MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parse_one_of_keywords

Method parse_one_of_keywords

src/sql-parser/src/parser.rs:1894–1902  ·  view source on GitHub ↗
(&mut self, kws: &[Keyword])

Source from the content-addressed store, hash-verified

1892 /// Look for one of the given keywords and return the one that matches.
1893 #[must_use]
1894 fn parse_one_of_keywords(&mut self, kws: &[Keyword]) -> Option<Keyword> {
1895 match self.peek_token() {
1896 Some(Token::Keyword(k)) if kws.contains(&k) => {
1897 self.next_token();
1898 Some(k)
1899 }
1900 _ => None,
1901 }
1902 }
1903
1904 /// Bail out if the current token is not one of the expected keywords, or consume it if it is
1905 fn expect_one_of_keywords(&mut self, keywords: &[Keyword]) -> Result<Keyword, ParserError> {

Callers 15

parse_trim_exprMethod · 0.80
parse_infixMethod · 0.80
parse_likeMethod · 0.80
parse_createMethod · 0.80
parse_create_sourceMethod · 0.80
parse_role_attributesMethod · 0.80
parse_create_typeMethod · 0.80

Calls 3

peek_tokenMethod · 0.80
next_tokenMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected