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

Method expect_keyword

src/sql-parser/src/parser.rs:1918–1924  ·  view source on GitHub ↗

Bail out if the current token is not an expected keyword, or consume it if it is

(&mut self, expected: Keyword)

Source from the content-addressed store, hash-verified

1916
1917 /// Bail out if the current token is not an expected keyword, or consume it if it is
1918 fn expect_keyword(&mut self, expected: Keyword) -> Result<(), ParserError> {
1919 if self.parse_keyword(expected) {
1920 Ok(())
1921 } else {
1922 self.expected(self.peek_pos(), expected, self.peek_token())
1923 }
1924 }
1925
1926 /// Bail out if the following tokens are not the expected sequence of
1927 /// keywords, or consume them if they are.

Callers 15

parse_functionMethod · 0.80
parse_window_frameMethod · 0.80
parse_case_exprMethod · 0.80
parse_cast_exprMethod · 0.80
parse_extract_exprMethod · 0.80
parse_infixMethod · 0.80
parse_betweenMethod · 0.80
expect_keywordsMethod · 0.80
parse_create_databaseMethod · 0.80
parse_create_schemaMethod · 0.80
parse_formatMethod · 0.80
parse_avro_schemaMethod · 0.80

Calls 4

parse_keywordMethod · 0.80
expectedMethod · 0.80
peek_posMethod · 0.80
peek_tokenMethod · 0.80

Tested by

no test coverage detected