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

Function isSamePrecedence

parser/unparser.go:482–489  ·  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

480//
481// If the expr is not a Call, the result is false.
482func isSamePrecedence(op string, expr ast.Expr) bool {
483 if expr.Kind() != ast.CallKind {
484 return false
485 }
486 c := expr.AsCall()
487 other := c.FunctionName()
488 return operators.Precedence(op) == operators.Precedence(other)
489}
490
491// isLowerPrecedence indicates whether the precedence of the input operator is lower precedence
492// 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