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

Method generateFunctionBinding

repl/evaluator.go:298–314  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

296}
297
298func (l *letFunction) generateFunctionBinding() []cel.OverloadOpt {
299 if l.impl == nil {
300 return nil
301 }
302 argLen := len(l.params)
303 if l.receiver != nil {
304 argLen++
305 }
306 switch argLen {
307 case 1:
308 return []cel.OverloadOpt{cel.UnaryBinding(func(v ref.Val) ref.Val { return l.impl(v) })}
309 case 2:
310 return []cel.OverloadOpt{cel.BinaryBinding(func(lhs ref.Val, rhs ref.Val) ref.Val { return l.impl(lhs, rhs) })}
311 default:
312 return []cel.OverloadOpt{cel.FunctionBinding(l.impl)}
313 }
314}
315
316// Reset plan if we need to recompile based on a dependency change.
317func (l *letVariable) clearPlan() {

Callers 1

updateMethod · 0.95

Calls 3

UnaryBindingFunction · 0.92
BinaryBindingFunction · 0.92
FunctionBindingFunction · 0.92

Tested by

no test coverage detected