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

Function quantifierExists

ext/comprehensions.go:260–276  ·  view source on GitHub ↗
(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr)

Source from the content-addressed store, hash-verified

258}
259
260func quantifierExists(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) {
261 iterVar1, iterVar2, err := extractIterVars(mef, args[0], args[1])
262 if err != nil {
263 return nil, err
264 }
265
266 return mef.NewComprehensionTwoVar(
267 target,
268 iterVar1,
269 iterVar2,
270 mef.AccuIdentName(),
271 /*accuInit=*/ mef.NewLiteral(types.False),
272 /*condition=*/ mef.NewCall(operators.NotStrictlyFalse, mef.NewCall(operators.LogicalNot, mef.NewAccuIdent())),
273 /*step=*/ mef.NewCall(operators.LogicalOr, mef.NewAccuIdent(), args[2]),
274 /*result=*/ mef.NewAccuIdent(),
275 ), nil
276}
277
278func quantifierExistsOne(mef cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) {
279 iterVar1, iterVar2, err := extractIterVars(mef, args[0], args[1])

Callers

nothing calls this directly

Calls 6

extractIterVarsFunction · 0.85
AccuIdentNameMethod · 0.65
NewLiteralMethod · 0.65
NewCallMethod · 0.65
NewAccuIdentMethod · 0.65

Tested by

no test coverage detected