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

Method NewAST

cel/optimizer.go:273–275  ·  view source on GitHub ↗

NewAST creates an AST from the current expression using the tracked source info which is modified and managed by the OptimizerContext.

(expr ast.Expr)

Source from the content-addressed store, hash-verified

271// NewAST creates an AST from the current expression using the tracked source info which
272// is modified and managed by the OptimizerContext.
273func (opt *optimizerExprFactory) NewAST(expr ast.Expr) *ast.AST {
274 return ast.NewAST(expr, opt.sourceInfo)
275}
276
277// CopyAST creates a renumbered copy of `Expr` and `SourceInfo` values of the input AST, where the
278// renumbering uses the same scheme as the core optimizer logic ensuring there are no collisions

Callers 7

OptimizeMethod · 0.80
OptimizeMethod · 0.80
evalCallFunction · 0.80
OptimizeMethod · 0.80
OptimizeMethod · 0.80
OptimizeMethod · 0.80

Calls 1

NewASTFunction · 0.92

Tested by 3

OptimizeMethod · 0.64
OptimizeMethod · 0.64
OptimizeMethod · 0.64