PlanProgram generates an evaluable instance of the AST in the go-native representation within the environment (Env).
(a *celast.AST, opts ...ProgramOption)
| 726 | // PlanProgram generates an evaluable instance of the AST in the go-native representation within |
| 727 | // the environment (Env). |
| 728 | func (e *Env) PlanProgram(a *celast.AST, opts ...ProgramOption) (Program, error) { |
| 729 | optSet := e.progOpts |
| 730 | if len(opts) != 0 { |
| 731 | mergedOpts := []ProgramOption{} |
| 732 | mergedOpts = append(mergedOpts, e.progOpts...) |
| 733 | mergedOpts = append(mergedOpts, opts...) |
| 734 | optSet = mergedOpts |
| 735 | } |
| 736 | return newProgram(e, a, optSet) |
| 737 | } |
| 738 | |
| 739 | // CELTypeAdapter returns the `types.Adapter` configured for the environment. |
| 740 | func (e *Env) CELTypeAdapter() types.Adapter { |