Program is an evaluable view of an Ast.
| 28 | |
| 29 | // Program is an evaluable view of an Ast. |
| 30 | type Program interface { |
| 31 | // Eval returns the result of an evaluation of the Ast and environment against the input vars. |
| 32 | // |
| 33 | // The vars value may either be an `Activation` or a `map[string]any`. |
| 34 | // |
| 35 | // If the `OptTrackState`, `OptTrackCost` or `OptExhaustiveEval` flags are used, the `details` response will |
| 36 | // be non-nil. Given this caveat on `details`, the return state from evaluation will be: |
| 37 | // |
| 38 | // * `val`, `details`, `nil` - Successful evaluation of a non-error result. |
| 39 | // * `val`, `details`, `err` - Successful evaluation to an error result. |
| 40 | // * `nil`, `details`, `err` - Unsuccessful evaluation. |
| 41 | // |
| 42 | // An unsuccessful evaluation is typically the result of a series of incompatible `EnvOption` |
| 43 | // or `ProgramOption` values used in the creation of the evaluation environment or executable |
| 44 | // program. |
| 45 | Eval(any) (ref.Val, *EvalDetails, error) |
| 46 | |
| 47 | // ContextEval evaluates the program with a set of input variables and a context object in order |
| 48 | // to support cancellation and timeouts. This method must be used in conjunction with the |
| 49 | // InterruptCheckFrequency() option for cancellation interrupts to be impact evaluation. |
| 50 | // |
| 51 | // The vars value may either be an `Activation` or `map[string]any`. |
| 52 | // |
| 53 | // The output contract for `ContextEval` is otherwise identical to the `Eval` method. |
| 54 | ContextEval(context.Context, any) (ref.Val, *EvalDetails, error) |
| 55 | } |
| 56 | |
| 57 | // Activation used to resolve identifiers by name and references by id. |
| 58 | // |
no outgoing calls
no test coverage detected