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

Method ProgramOptions

ext/math.go:600–614  ·  view source on GitHub ↗

ProgramOptions implements the Library interface method.

()

Source from the content-addressed store, hash-verified

598
599// ProgramOptions implements the Library interface method.
600func (lib *mathLib) ProgramOptions() []cel.ProgramOption {
601 var opts []cel.ProgramOption
602 if lib.version >= 3 {
603 trackers := []interpreter.CostTrackerOption{
604 interpreter.OverloadCostTracker("math_@min_list_double", trackMathListCost),
605 interpreter.OverloadCostTracker("math_@min_list_int", trackMathListCost),
606 interpreter.OverloadCostTracker("math_@min_list_uint", trackMathListCost),
607 interpreter.OverloadCostTracker("math_@max_list_double", trackMathListCost),
608 interpreter.OverloadCostTracker("math_@max_list_int", trackMathListCost),
609 interpreter.OverloadCostTracker("math_@max_list_uint", trackMathListCost),
610 }
611 opts = append(opts, cel.CostTrackerOptions(trackers...))
612 }
613 return opts
614}
615
616func mathLeast(meh cel.MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *cel.Error) {
617 if !macroTargetMatchesNamespace(mathNamespace, target) {

Callers

nothing calls this directly

Calls 2

OverloadCostTrackerFunction · 0.92
CostTrackerOptionsFunction · 0.92

Tested by

no test coverage detected