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

Function OptimizeWithSource

cel/optimizer.go:66–71  ·  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

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.
66func 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//

Callers 2

ComposeMethod · 0.92
TestOptimizeWithSourceFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestOptimizeWithSourceFunction · 0.74