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