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

Method NewLiteral

cel/optimizer.go:392–394  ·  view source on GitHub ↗

NewLiteral creates a new literal expression value. The range of valid values for a literal generated during optimization is different than for expressions generated via parsing / type-checking, as the ref.Val may be _any_ CEL value so long as the value can be converted back to a literal-like form.

(value ref.Val)

Source from the content-addressed store, hash-verified

390// generated via parsing / type-checking, as the ref.Val may be _any_ CEL value so long as the value can
391// be converted back to a literal-like form.
392func (opt *optimizerExprFactory) NewLiteral(value ref.Val) ast.Expr {
393 return opt.fac.NewLiteral(opt.nextID(), value)
394}
395
396// NewList creates a list expression with a set of optional indices.
397//

Callers

nothing calls this directly

Calls 2

NewLiteralMethod · 0.65
nextIDMethod · 0.45

Tested by

no test coverage detected