MCPcopy Create free account
hub / github.com/PRQL/prql / associativity

Function associativity

prqlc/prqlc/src/codegen/ast.rs:287–303  ·  view source on GitHub ↗
(expr: &pr::ExprKind)

Source from the content-addressed store, hash-verified

285}
286
287fn 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.
306fn can_bind_left(expr: &pr::ExprKind) -> bool {

Callers 1

needs_parenthesisFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected