MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / Format

Method Format

pkg/sql/inverted/expression.go:141–154  ·  view source on GitHub ↗

Format pretty-prints the spans.

(tp treeprinter.Node, label string, redactable bool)

Source from the content-addressed store, hash-verified

139
140// Format pretty-prints the spans.
141func (is Spans) Format(tp treeprinter.Node, label string, redactable bool) {
142 if len(is) == 0 {
143 tp.Childf("%s: empty", label)
144 return
145 }
146 if len(is) == 1 {
147 tp.Childf("%s: %s", label, formatSpan(is[0], redactable))
148 return
149 }
150 n := tp.Child(label)
151 for i := 0; i < len(is); i++ {
152 n.Child(formatSpan(is[i], redactable))
153 }
154}
155
156func formatSpan(span Span, redactable bool) string {
157 spanEndOpenOrClosed := ')'

Callers

nothing calls this directly

Calls 3

formatSpanFunction · 0.85
ChildfMethod · 0.80
ChildMethod · 0.80

Tested by

no test coverage detected