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

Function Heights

common/ast/ast.go:194–198  ·  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

192
193// Heights computes the heights of all AST expressions and returns a map from expression id to height.
194func Heights(a *AST) map[int64]int {
195 visitor := make(heightVisitor)
196 PostOrderVisit(a.Expr(), visitor)
197 return visitor
198}
199
200// NewSourceInfo creates a simple SourceInfo object from an input common.Source value.
201func 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