Heights computes the heights of all AST expressions and returns a map from expression id to height.
(a *AST)
| 184 | |
| 185 | // Heights computes the heights of all AST expressions and returns a map from expression id to height. |
| 186 | func 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. |
| 193 | func NewSourceInfo(src common.Source) *SourceInfo { |