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

Function NewCheckedAST

common/ast/ast.go:121–128  ·  view source on GitHub ↗

NewCheckedAST wraps an parsed AST and augments it with type and reference metadata.

(parsed *AST, typeMap map[int64]*types.Type, refMap map[int64]*ReferenceInfo)

Source from the content-addressed store, hash-verified

119
120// NewCheckedAST wraps an parsed AST and augments it with type and reference metadata.
121func NewCheckedAST(parsed *AST, typeMap map[int64]*types.Type, refMap map[int64]*ReferenceInfo) *AST {
122 return &AST{
123 expr: parsed.Expr(),
124 sourceInfo: parsed.SourceInfo(),
125 typeMap: typeMap,
126 refMap: refMap,
127 }
128}
129
130// Copy creates a deep copy of the Expr and SourceInfo values in the input AST.
131//

Callers 6

CheckFunction · 0.92
tryFoldMethod · 0.92
TestASTNilSafetyFunction · 0.92
TestConvertASTFunction · 0.92
CopyFunction · 0.85
ToASTFunction · 0.85

Calls 2

ExprMethod · 0.65
SourceInfoMethod · 0.45

Tested by 2

TestASTNilSafetyFunction · 0.74
TestConvertASTFunction · 0.74