MCPcopy Create free account
hub / github.com/cel-expr/cel-go / isComplexOperatorWithRespectTo

Function isComplexOperatorWithRespectTo

parser/unparser.go:513–518  ·  view source on GitHub ↗

Indicates whether it is a complex operation compared to another. expr is *not* considered complex if it is not a call expression or has less than two arguments, or if it has a higher precedence than op.

(op string, expr ast.Expr)

Source from the content-addressed store, hash-verified

511// expr is *not* considered complex if it is not a call expression or has
512// less than two arguments, or if it has a higher precedence than op.
513func isComplexOperatorWithRespectTo(op string, expr ast.Expr) bool {
514 if expr.Kind() != ast.CallKind || len(expr.AsCall().Args()) < 2 {
515 return false
516 }
517 return isLowerPrecedence(op, expr)
518}
519
520// Indicate whether this is a binary or ternary operator.
521func isBinaryOrTernaryOperator(expr ast.Expr) bool {

Callers 1

visitCallBinaryMethod · 0.85

Calls 4

isLowerPrecedenceFunction · 0.85
KindMethod · 0.65
ArgsMethod · 0.65
AsCallMethod · 0.65

Tested by

no test coverage detected