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

Method parse_between

src/sql-parser/src/parser.rs:1628–1640  ·  view source on GitHub ↗

Parses `BETWEEN AND `, assuming the `BETWEEN` keyword was already consumed

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

Source from the content-addressed store, hash-verified

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> {
1629 // Stop parsing subexpressions for <low> and <high> on tokens with
1630 // precedence lower than that of `BETWEEN`, such as `AND`, `IS`, etc.
1631 let low = self.parse_subexpr(Precedence::Like)?;
1632 self.expect_keyword(AND)?;
1633 let high = self.parse_subexpr(Precedence::Like)?;
1634 Ok(Expr::Between {
1635 expr: Box::new(expr),
1636 negated,
1637 low: Box::new(low),
1638 high: Box::new(high),
1639 })
1640 }
1641
1642 /// Parses `LIKE <pattern> [ ESCAPE <char> ]`, assuming the `LIKE` keyword was already consumed
1643 fn parse_like(

Callers 1

parse_infixMethod · 0.80

Calls 2

parse_subexprMethod · 0.80
expect_keywordMethod · 0.80

Tested by

no test coverage detected