PlanProgram generates an evaluable instance of the AST in the go-native representation within the environment (Env).
(a *celast.AST, opts ...ProgramOption)
| 798 | // PlanProgram generates an evaluable instance of the AST in the go-native representation within |
| 799 | // the environment (Env). |
| 800 | func (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 | |
| 811 | func (e *Env) initDispatcher() (interpreter.Dispatcher, bool, error) { |
| 812 | e.dispOnce.Do(func() { |