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

Method parse_optional_option_value

src/sql-parser/src/parser.rs:5526–5538  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

5524 }
5525
5526 fn parse_optional_option_value(&mut self) -> Result<Option<WithOptionValue<Raw>>, ParserError> {
5527 // The next token might be a value and might not. The only valid things
5528 // that indicate no value would be `)` for end-of-options , `,` for
5529 // another-option, or ';'/nothing for end-of-statement. Either of those
5530 // means there's no value, anything else means we expect a valid value.
5531 match self.peek_token() {
5532 Some(Token::RParen) | Some(Token::Comma) | Some(Token::Semicolon) | None => Ok(None),
5533 _ => {
5534 let _ = self.consume_token(&Token::Eq);
5535 Ok(Some(self.parse_option_value()?))
5536 }
5537 }
5538 }
5539
5540 fn parse_option_sequence<T, F>(&mut self, f: F) -> Result<Option<Vec<T>>, ParserError>
5541 where

Calls 3

peek_tokenMethod · 0.80
consume_tokenMethod · 0.80
parse_option_valueMethod · 0.80

Tested by

no test coverage detected