PlanProgram generates an evaluable instance of the AST in the go-native representation within the environment (Env).
(a *celast.AST, opts ...ProgramOption)
| 693 | // PlanProgram generates an evaluable instance of the AST in the go-native representation within |
| 694 | // the environment (Env). |
| 695 | func (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. |
| 707 | func (e *Env) CELTypeAdapter() types.Adapter { |