| 80 | type leafReference struct{ p value.Pointer } |
| 81 | |
| 82 | func wrapTrunkReferences(pp [2]value.Pointer, s textNode) textNode { |
| 83 | switch { |
| 84 | case pp[0].IsNil(): |
| 85 | return &textWrap{Value: s, Metadata: trunkReference{pp[1]}} |
| 86 | case pp[1].IsNil(): |
| 87 | return &textWrap{Value: s, Metadata: trunkReference{pp[0]}} |
| 88 | case pp[0] == pp[1]: |
| 89 | return &textWrap{Value: s, Metadata: trunkReference{pp[0]}} |
| 90 | default: |
| 91 | return &textWrap{Value: s, Metadata: trunkReferences{pp}} |
| 92 | } |
| 93 | } |
| 94 | func wrapTrunkReference(p value.Pointer, printAddress bool, s textNode) textNode { |
| 95 | var prefix string |
| 96 | if printAddress { |