MCPcopy Index your code
hub / github.com/cockscomb/cel2sql / isBinaryOrTernaryOperator

Function isBinaryOrTernaryOperator

cel2sql.go:782–788  ·  view source on GitHub ↗

Indicate whether this is a binary or ternary operator.

(expr *exprpb.Expr)

Source from the content-addressed store, hash-verified

780
781// Indicate whether this is a binary or ternary operator.
782func isBinaryOrTernaryOperator(expr *exprpb.Expr) bool {
783 if expr.GetCallExpr() == nil || len(expr.GetCallExpr().GetArgs()) < 2 {
784 return false
785 }
786 _, isBinaryOp := operators.FindReverseBinaryOperator(expr.GetCallExpr().GetFunction())
787 return isBinaryOp || isSamePrecedence(operators.Conditional, expr)
788}
789
790func isNullLiteral(node *exprpb.Expr) bool {
791 _, isConst := node.ExprKind.(*exprpb.Expr_ConstExpr)

Callers 5

callContainsMethod · 0.85
visitCallFuncMethod · 0.85
visitCallMapIndexMethod · 0.85
visitCallListIndexMethod · 0.85
visitSelectMethod · 0.85

Calls 1

isSamePrecedenceFunction · 0.85

Tested by

no test coverage detected