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

Method expect_token

src/sql-parser/src/parser.rs:1948–1954  ·  view source on GitHub ↗

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

(&mut self, expected: &Token)

Source from the content-addressed store, hash-verified

1946
1947 /// Bail out if the current token is not an expected token, or consume it if it is
1948 fn expect_token(&mut self, expected: &Token) -> Result<(), ParserError> {
1949 if self.consume_token(expected) {
1950 Ok(())
1951 } else {
1952 self.expected(self.peek_pos(), expected, self.peek_token())
1953 }
1954 }
1955
1956 /// Bail out if the current token is not one of the expected tokens, or consume it if it is
1957 fn expect_one_of_tokens(&mut self, tokens: &[Token]) -> Result<Token, ParserError> {

Callers 15

parse_prefixMethod · 0.80
parse_functionMethod · 0.80
parse_cast_exprMethod · 0.80
parse_exists_exprMethod · 0.80
parse_nullif_exprMethod · 0.80
parse_extract_exprMethod · 0.80
parse_row_exprMethod · 0.80
parse_trim_exprMethod · 0.80
parse_position_exprMethod · 0.80

Calls 4

consume_tokenMethod · 0.80
expectedMethod · 0.80
peek_posMethod · 0.80
peek_tokenMethod · 0.80

Tested by

no test coverage detected