| 285 | } |
| 286 | |
| 287 | fn associativity(expr: &pr::ExprKind) -> super::Position { |
| 288 | match expr { |
| 289 | pr::ExprKind::Binary(pr::BinaryExpr { op, .. }) => match op { |
| 290 | pr::BinOp::Pow => super::Position::Right, |
| 291 | pr::BinOp::Eq |
| 292 | | pr::BinOp::Ne |
| 293 | | pr::BinOp::Gt |
| 294 | | pr::BinOp::Lt |
| 295 | | pr::BinOp::Gte |
| 296 | | pr::BinOp::Lte |
| 297 | | pr::BinOp::RegexSearch => super::Position::Unspecified, |
| 298 | _ => super::Position::Left, |
| 299 | }, |
| 300 | |
| 301 | _ => super::Position::Unspecified, |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | /// True if this expression could be mistakenly bound with an expression on the left. |
| 306 | fn can_bind_left(expr: &pr::ExprKind) -> bool { |