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

Method expect_one_of_keywords

src/sql-parser/src/parser.rs:1905–1915  ·  view source on GitHub ↗

Bail out if the current token is not one of the expected keywords, or consume it if it is

(&mut self, keywords: &[Keyword])

Source from the content-addressed store, hash-verified

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> {
1906 if let Some(keyword) = self.parse_one_of_keywords(keywords) {
1907 Ok(keyword)
1908 } else {
1909 self.expected(
1910 self.peek_pos(),
1911 format!("one of {}", keywords.iter().join(" or ")),
1912 self.peek_token(),
1913 )
1914 }
1915 }
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> {

Calls 4

parse_one_of_keywordsMethod · 0.80
expectedMethod · 0.80
peek_posMethod · 0.80
peek_tokenMethod · 0.80

Tested by

no test coverage detected