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

Function isSamePrecedence

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

isSamePrecedence indicates whether the precedence of the input operator is the same as the precedence of the (possible) operation represented in the input Expr. If the expr is not a Call, the result is false.

(op string, expr ast.Expr)

Source from the content-addressed store, hash-verified

518//
519// If the expr is not a Call, the result is false.
520func isSamePrecedence(op string, expr ast.Expr) bool {
521 if expr.Kind() != ast.CallKind {
522 return false
523 }
524 c := expr.AsCall()
525 other := c.FunctionName()
526 return operators.Precedence(op) == operators.Precedence(other)
527}
528
529// isLowerPrecedence indicates whether the precedence of the input operator is lower precedence
530// than the (possible) operation represented in the input Expr.

Callers 3

visitCallBinaryMethod · 0.85
visitCallConditionalMethod · 0.85

Calls 4

PrecedenceFunction · 0.92
KindMethod · 0.65
AsCallMethod · 0.65
FunctionNameMethod · 0.65

Tested by

no test coverage detected