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

Function NewAST

common/ast/ast.go:108–118  ·  view source on GitHub ↗

NewAST creates a base AST instance with an ast.Expr and ast.SourceInfo value.

(e Expr, sourceInfo *SourceInfo)

Source from the content-addressed store, hash-verified

106
107// NewAST creates a base AST instance with an ast.Expr and ast.SourceInfo value.
108func NewAST(e Expr, sourceInfo *SourceInfo) *AST {
109 if e == nil {
110 e = nilExpr
111 }
112 return &AST{
113 expr: e,
114 sourceInfo: sourceInfo,
115 typeMap: make(map[int64]*types.Type),
116 refMap: make(map[int64]*ReferenceInfo),
117 }
118}
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 {

Callers 15

maybeUnnestRuleMethod · 0.92
PruneAstFunction · 0.92
TestCheckInvalidLiteralFunction · 0.92
ParseMethod · 0.92
TestBlockEvalFunction · 0.92
TestBlockEval_BadPlanFunction · 0.92
TestBlockEval_BadBlockFunction · 0.92

Calls

no outgoing calls