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

Function KindMatcher

common/ast/navigable.go:78–82  ·  view source on GitHub ↗

KindMatcher returns an ExprMatcher which will return true if the input NavigableExpr.Kind() matches the specified `kind`.

(kind ExprKind)

Source from the content-addressed store, hash-verified

76// KindMatcher returns an ExprMatcher which will return true if the input NavigableExpr.Kind() matches
77// the specified `kind`.
78func KindMatcher(kind ExprKind) ExprMatcher {
79 return func(e NavigableExpr) bool {
80 return e.Kind() == kind
81 }
82}
83
84// FunctionMatcher returns an ExprMatcher which will match NavigableExpr nodes of CallKind type whose
85// function name is equal to `funcName`.

Callers 7

ValidateMethod · 0.92
ValidateMethod · 0.92
OptimizeMethod · 0.92
TestNavigateASTFunction · 0.92
TestNavigableListExprFunction · 0.92
TestNavigableMapExprFunction · 0.92
TestNavigableStructExprFunction · 0.92

Calls 1

KindMethod · 0.65

Tested by 4

TestNavigateASTFunction · 0.74
TestNavigableListExprFunction · 0.74
TestNavigableMapExprFunction · 0.74
TestNavigableStructExprFunction · 0.74