(val Any, slot uint32)
| 32 | } |
| 33 | |
| 34 | func IPValue(val Any, slot uint32) netip.Addr { |
| 35 | switch val := val.(type) { |
| 36 | case *IP: |
| 37 | return val.Values[slot] |
| 38 | case *Const: |
| 39 | return IPValue(val.Any, 0) |
| 40 | case *Dict: |
| 41 | slot = uint32(val.Index[slot]) |
| 42 | return val.Any.(*IP).Values[slot] |
| 43 | case *View: |
| 44 | slot = val.Index[slot] |
| 45 | return IPValue(val.Any, slot) |
| 46 | } |
| 47 | panic(val) |
| 48 | } |