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 {

Calls

no outgoing calls