MCPcopy Create free account
hub / github.com/cel-expr/cel-go / OptimizeWithSource

Function OptimizeWithSource

cel/optimizer.go:67–72  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 2

ComposeMethod · 0.92
TestOptimizeWithSourceFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestOptimizeWithSourceFunction · 0.74