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

Function NodeCount

common/ast/ast.go:176–181  ·  view source on GitHub ↗

NodeCount returns the total number of expression nodes in the AST, including macro calls.

(a *AST)

Source from the content-addressed store, hash-verified

174
175// NodeCount returns the total number of expression nodes in the AST, including macro calls.
176func NodeCount(a *AST) int {
177 if a == nil {
178 return 0
179 }
180 return len(a.IDs())
181}
182
183// ClearUnusedIDs removes IDs not used in the AST or macro calls from SourceInfo.
184func (a *AST) ClearUnusedIDs() {

Callers 1

TestNodeCountFunction · 0.92

Calls 1

IDsMethod · 0.65

Tested by 1

TestNodeCountFunction · 0.74