textNode is a simplified tree-based representation of structured text. Possible node types are textWrap, textList, or textLine.
| 63 | // textNode is a simplified tree-based representation of structured text. |
| 64 | // Possible node types are textWrap, textList, or textLine. |
| 65 | type textNode interface { |
| 66 | // Len reports the length in bytes of a single-line version of the tree. |
| 67 | // Nested textRecord.Diff and textRecord.Comment fields are ignored. |
| 68 | Len() int |
| 69 | // Equal reports whether the two trees are structurally identical. |
| 70 | // Nested textRecord.Diff and textRecord.Comment fields are compared. |
| 71 | Equal(textNode) bool |
| 72 | // String returns the string representation of the text tree. |
| 73 | // It is not guaranteed that len(x.String()) == x.Len(), |
| 74 | // nor that x.String() == y.String() implies that x.Equal(y). |
| 75 | String() string |
| 76 | |
| 77 | // formatCompactTo formats the contents of the tree as a single-line string |
| 78 | // to the provided buffer. Any nested textRecord.Diff and textRecord.Comment |
| 79 | // fields are ignored. |
| 80 | // |
| 81 | // However, not all nodes in the tree should be collapsed as a single-line. |
| 82 | // If a node can be collapsed as a single-line, it is replaced by a textLine |
| 83 | // node. Since the top-level node cannot replace itself, this also returns |
| 84 | // the current node itself. |
| 85 | // |
| 86 | // This does not mutate the receiver. |
| 87 | formatCompactTo([]byte, diffMode) ([]byte, textNode) |
| 88 | // formatExpandedTo formats the contents of the tree as a multi-line string |
| 89 | // to the provided buffer. In order for column alignment to operate well, |
| 90 | // formatCompactTo must be called before calling formatExpandedTo. |
| 91 | formatExpandedTo([]byte, diffMode, indentMode) []byte |
| 92 | } |
| 93 | |
| 94 | // textWrap is a wrapper that concatenates a prefix and/or a suffix |
| 95 | // to the underlying node. |
no outgoing calls
no test coverage detected