Write `left` as the LHS of ` ANY/ALL (...)`. The printed ` ` is an ordinary binary infix. It can be any operator the parser accepts here, from `=`/`<` (`Cmp`) all the way down to `*`/`/`/`%` (`MultiplyDivide`), and on reparse it binds into any operator exposed on `left`'s right spine that is strictly looser* than ` ` itself, stealing that suffix into the quantified expression's le
(
f: &mut AstFormatter<W>,
expr: &Expr<T>,
op: &Op,
)
| 627 | /// `a + (b * ANY (…))`. [`right_edge`] also sees a looser spine hidden under |
| 628 | /// right-transparent prefixes, e.g. the `NOT`'s `IN` in `- NOT a IN (b) = ANY (…)`. |
| 629 | fn write_quantified_left<W: fmt::Write, T: AstInfo>( |
| 630 | f: &mut AstFormatter<W>, |
| 631 | expr: &Expr<T>, |
| 632 | op: &Op, |
| 633 | ) { |
| 634 | let needs_parens = right_edge(expr) < binary_op_precedence(op); |
| 635 | if needs_parens { |
| 636 | f.write_str("("); |
| 637 | f.write_node(expr); |
| 638 | f.write_str(")"); |
| 639 | } else { |
| 640 | f.write_node(expr); |
| 641 | } |
| 642 | } |
| 643 | |
| 644 | /// Write `bound` as a `BETWEEN … AND …` bound. The parser parses both bounds with |
| 645 | /// `parse_subexpr(Precedence::Like)` (see `Parser::parse_between`), starting fresh |
no test coverage detected