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

Function isBinaryOrTernaryOperator

parser/unparser.go:521–527  ·  view source on GitHub ↗

Indicate whether this is a binary or ternary operator.

(expr ast.Expr)

Source from the content-addressed store, hash-verified

519
520// Indicate whether this is a binary or ternary operator.
521func isBinaryOrTernaryOperator(expr ast.Expr) bool {
522 if expr.Kind() != ast.CallKind || len(expr.AsCall().Args()) < 2 {
523 return false
524 }
525 _, isBinaryOp := operators.FindReverseBinaryOperator(expr.AsCall().FunctionName())
526 return isBinaryOp || isSamePrecedence(operators.Conditional, expr)
527}
528
529// bytesToOctets converts byte sequences to a string using a three digit octal encoded value
530// per byte.

Callers 3

visitCallFuncMethod · 0.85
visitSelectInternalMethod · 0.85

Calls 6

isSamePrecedenceFunction · 0.85
KindMethod · 0.65
ArgsMethod · 0.65
AsCallMethod · 0.65
FunctionNameMethod · 0.65

Tested by

no test coverage detected