StaticOptimizer contains a sequence of ASTOptimizer instances which will be applied in order. The static optimizer normalizes expression ids and type-checking run between optimization passes to ensure that the final optimized output is a valid expression with metadata consistent with what would hav
| 33 | // Note: source position information is best-effort and incomplete, but optimized expressions |
| 34 | // should be suitable for calls to parser.Unparse. |
| 35 | type StaticOptimizer struct { |
| 36 | optimizers []ASTOptimizer |
| 37 | // If set, Optimize() will use this Source instead of the one from the AST. |
| 38 | sourceOverride *Source |
| 39 | } |
| 40 | |
| 41 | // OptimizerOption configures a StaticOptimizer instance. |
| 42 | type OptimizerOption func(*StaticOptimizer) (*StaticOptimizer, error) |
nothing calls this directly
no outgoing calls
no test coverage detected