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

Method PlanProgram

cel/env.go:800–809  ·  view source on GitHub ↗

PlanProgram generates an evaluable instance of the AST in the go-native representation within the environment (Env).

(a *celast.AST, opts ...ProgramOption)

Source from the content-addressed store, hash-verified

798// PlanProgram generates an evaluable instance of the AST in the go-native representation within
799// the environment (Env).
800func (e *Env) PlanProgram(a *celast.AST, opts ...ProgramOption) (Program, error) {
801 optSet := e.progOpts
802 if len(opts) != 0 {
803 mergedOpts := []ProgramOption{}
804 mergedOpts = append(mergedOpts, e.progOpts...)
805 mergedOpts = append(mergedOpts, opts...)
806 optSet = mergedOpts
807 }
808 return newProgram(e, a, optSet)
809}
810
811func (e *Env) initDispatcher() (interpreter.Dispatcher, bool, error) {
812 e.dispOnce.Do(func() {

Callers 7

TestBlockEvalFunction · 0.95
TestBlockEval_BadPlanFunction · 0.95
TestBlockEval_BadBlockFunction · 0.95
BenchmarkBlockEvalFunction · 0.95
ProgramMethod · 0.95
TestWhitespaceHanldingFunction · 0.80

Calls 1

newProgramFunction · 0.85

Tested by 6

TestBlockEvalFunction · 0.76
TestBlockEval_BadPlanFunction · 0.76
TestBlockEval_BadBlockFunction · 0.76
BenchmarkBlockEvalFunction · 0.76
TestWhitespaceHanldingFunction · 0.64