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

Method Format

pkg/sql/inverted/expression.go:403–420  ·  view source on GitHub ↗

Format pretty-prints the SpanExpression.

(tp treeprinter.Node, includeSpansToRead, redactable bool)

Source from the content-addressed store, hash-verified

401
402// Format pretty-prints the SpanExpression.
403func (s *SpanExpression) Format(tp treeprinter.Node, includeSpansToRead, redactable bool) {
404 tp.Childf("tight: %t, unique: %t", s.Tight, s.Unique)
405 if includeSpansToRead {
406 s.SpansToRead.Format(tp, "to read", redactable)
407 }
408 s.FactoredUnionSpans.Format(tp, "union spans", redactable)
409 if s.Operator == None {
410 return
411 }
412 switch s.Operator {
413 case SetUnion:
414 tp = tp.Child("UNION")
415 case SetIntersection:
416 tp = tp.Child("INTERSECTION")
417 }
418 formatExpression(tp, s.Left, includeSpansToRead, redactable)
419 formatExpression(tp, s.Right, includeSpansToRead, redactable)
420}
421
422func formatExpression(tp treeprinter.Node, expr Expression, includeSpansToRead, redactable bool) {
423 switch e := expr.(type) {

Callers 1

StringMethod · 0.95

Calls 4

formatExpressionFunction · 0.85
ChildfMethod · 0.80
ChildMethod · 0.80
FormatMethod · 0.65

Tested by

no test coverage detected