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

Function FunctionMatcher

common/ast/navigable.go:86–93  ·  view source on GitHub ↗

FunctionMatcher returns an ExprMatcher which will match NavigableExpr nodes of CallKind type whose function name is equal to `funcName`.

(funcName string)

Source from the content-addressed store, hash-verified

84// FunctionMatcher returns an ExprMatcher which will match NavigableExpr nodes of CallKind type whose
85// function name is equal to `funcName`.
86func FunctionMatcher(funcName string) ExprMatcher {
87 return func(e NavigableExpr) bool {
88 if e.Kind() != CallKind {
89 return false
90 }
91 return e.AsCall().FunctionName() == funcName
92 }
93}
94
95// AllMatcher returns true for all descendants of a NavigableExpr, effectively flattening them into a list.
96//

Callers 4

ValidateMethod · 0.92
ValidateMethod · 0.92

Calls 3

KindMethod · 0.65
FunctionNameMethod · 0.65
AsCallMethod · 0.65

Tested by 2