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

Method PlanProgram

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

693// PlanProgram generates an evaluable instance of the AST in the go-native representation within
694// the environment (Env).
695func (e *Env) PlanProgram(a *celast.AST, opts ...ProgramOption) (Program, error) {
696 optSet := e.progOpts
697 if len(opts) != 0 {
698 mergedOpts := []ProgramOption{}
699 mergedOpts = append(mergedOpts, e.progOpts...)
700 mergedOpts = append(mergedOpts, opts...)
701 optSet = mergedOpts
702 }
703 return newProgram(e, a, optSet)
704}
705
706// CELTypeAdapter returns the `types.Adapter` configured for the environment.
707func (e *Env) CELTypeAdapter() types.Adapter {

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