VisitEntryExpr computes the max height of a map or struct entry and associates the height with the entry id.
(e EntryExpr)
| 638 | |
| 639 | // VisitEntryExpr computes the max height of a map or struct entry and associates the height with the entry id. |
| 640 | func (hv heightVisitor) VisitEntryExpr(e EntryExpr) { |
| 641 | hv[e.ID()] = 0 |
| 642 | switch e.Kind() { |
| 643 | case MapEntryKind: |
| 644 | me := e.AsMapEntry() |
| 645 | hv[e.ID()] = hv.maxHeight(me.Value(), me.Key()) |
| 646 | case StructFieldKind: |
| 647 | sf := e.AsStructField() |
| 648 | hv[e.ID()] = hv[sf.Value().ID()] |
| 649 | } |
| 650 | } |
| 651 | |
| 652 | func (hv heightVisitor) maxHeight(exprs ...Expr) int { |
| 653 | max := 0 |
nothing calls this directly
no test coverage detected