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

Function Heights

common/ast/ast.go:186–190  ·  view source on GitHub ↗

Heights computes the heights of all AST expressions and returns a map from expression id to height.

(a *AST)

Source from the content-addressed store, hash-verified

184
185// Heights computes the heights of all AST expressions and returns a map from expression id to height.
186func Heights(a *AST) map[int64]int {
187 visitor := make(heightVisitor)
188 PostOrderVisit(a.Expr(), visitor)
189 return visitor
190}
191
192// NewSourceInfo creates a simple SourceInfo object from an input common.Source value.
193func NewSourceInfo(src common.Source) *SourceInfo {

Callers 2

maybeUnnestRuleMethod · 0.92
TestHeightsFunction · 0.92

Calls 2

PostOrderVisitFunction · 0.85
ExprMethod · 0.65

Tested by 1

TestHeightsFunction · 0.74