OptimizeWithSource overrides the source used by the optimizer. Note this will cause the source info from the AST passed to Optimize() to be discarded.
(source Source)
| 64 | // OptimizeWithSource overrides the source used by the optimizer. |
| 65 | // Note this will cause the source info from the AST passed to Optimize() to be discarded. |
| 66 | func OptimizeWithSource(source Source) OptimizerOption { |
| 67 | return func(so *StaticOptimizer) (*StaticOptimizer, error) { |
| 68 | so.sourceOverride = &source |
| 69 | return so, nil |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | // Optimize applies a sequence of optimizations to an Ast within a given environment. |
| 74 | // |
no outgoing calls