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

Method PlanProgram

cel/env.go:735–744  ·  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

733// PlanProgram generates an evaluable instance of the AST in the go-native representation within
734// the environment (Env).
735func (e *Env) PlanProgram(a *celast.AST, opts ...ProgramOption) (Program, error) {
736 optSet := e.progOpts
737 if len(opts) != 0 {
738 mergedOpts := []ProgramOption{}
739 mergedOpts = append(mergedOpts, e.progOpts...)
740 mergedOpts = append(mergedOpts, opts...)
741 optSet = mergedOpts
742 }
743 return newProgram(e, a, optSet)
744}
745
746func (e *Env) initDispatcher() (interpreter.Dispatcher, bool, error) {
747 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