Write `operand` for a binary operator, parenthesizing it iff `needs_parens`.
(
f: &mut AstFormatter<W>,
operand: &Expr<T>,
needs_parens: bool,
)
| 813 | |
| 814 | /// Write `operand` for a binary operator, parenthesizing it iff `needs_parens`. |
| 815 | fn write_binary_operand<W: fmt::Write, T: AstInfo>( |
| 816 | f: &mut AstFormatter<W>, |
| 817 | operand: &Expr<T>, |
| 818 | needs_parens: bool, |
| 819 | ) { |
| 820 | if needs_parens { |
| 821 | f.write_str("("); |
| 822 | f.write_node(operand); |
| 823 | f.write_str(")"); |
| 824 | } else { |
| 825 | f.write_node(operand); |
| 826 | } |
| 827 | } |
| 828 | |
| 829 | /// Whether `expr` prints in a *self-delimiting* form — atomic, or wrapped in its |
| 830 | /// own brackets/parens (`name(...)`, `(…)`, `ARRAY[…]`, `CASE … END`, …) — so it |
no test coverage detected