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

Function isBinaryOrTernaryOperator

parser/unparser.go:583–589  ·  view source on GitHub ↗

Indicate whether this is a binary or ternary operator.

(expr ast.Expr)

Source from the content-addressed store, hash-verified

581
582// Indicate whether this is a binary or ternary operator.
583func isBinaryOrTernaryOperator(expr ast.Expr) bool {
584 if expr.Kind() != ast.CallKind || len(expr.AsCall().Args()) < 2 {
585 return false
586 }
587 _, isBinaryOp := operators.FindReverseBinaryOperator(expr.AsCall().FunctionName())
588 return isBinaryOp || isSamePrecedence(operators.Conditional, expr)
589}
590
591// bytesToOctets converts byte sequences to a string using a three digit octal encoded value
592// 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