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