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

Method parse_in

src/sql-parser/src/parser.rs:1609–1625  ·  view source on GitHub ↗

Parses the parens following the `[ NOT ] IN` operator

(&mut self, expr: Expr<Raw>, negated: bool)

Source from the content-addressed store, hash-verified

1607
1608 /// Parses the parens following the `[ NOT ] IN` operator
1609 fn parse_in(&mut self, expr: Expr<Raw>, negated: bool) -> Result<Expr<Raw>, ParserError> {
1610 self.expect_token(&Token::LParen)?;
1611 let in_op = match self.parse_parenthesized_fragment()? {
1612 ParenthesizedFragment::Exprs(list) => Expr::InList {
1613 expr: Box::new(expr),
1614 list,
1615 negated,
1616 },
1617 ParenthesizedFragment::Query(subquery) => Expr::InSubquery {
1618 expr: Box::new(expr),
1619 subquery: Box::new(subquery),
1620 negated,
1621 },
1622 };
1623 self.expect_token(&Token::RParen)?;
1624 Ok(in_op)
1625 }
1626
1627 /// Parses `BETWEEN <low> AND <high>`, assuming the `BETWEEN` keyword was already consumed
1628 fn parse_between(&mut self, expr: Expr<Raw>, negated: bool) -> Result<Expr<Raw>, ParserError> {

Callers 1

parse_infixMethod · 0.80

Calls 2

expect_tokenMethod · 0.80

Tested by

no test coverage detected