Format pretty-prints the SpanExpression.
(tp treeprinter.Node, includeSpansToRead, redactable bool)
| 401 | |
| 402 | // Format pretty-prints the SpanExpression. |
| 403 | func (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 | |
| 422 | func formatExpression(tp treeprinter.Node, expr Expression, includeSpansToRead, redactable bool) { |
| 423 | switch e := expr.(type) { |
no test coverage detected