MCPcopy Create free account
hub / github.com/dolthub/doltgresql / JoinNestedRight

Function JoinNestedRight

postgres/parser/pretty/util.go:61–74  ·  view source on GitHub ↗

JoinNestedRight nests nested with string s. Every item after the first is indented. For example: aaaa bbb bbb ccc ccc

(sep Doc, nested ...Doc)

Source from the content-addressed store, hash-verified

59//
60// ccc
61func JoinNestedRight(sep Doc, nested ...Doc) Doc {
62 switch len(nested) {
63 case 0:
64 return Nil
65 case 1:
66 return nested[0]
67 default:
68 return Concat(
69 nested[0],
70 FoldMap(Concat,
71 func(a Doc) Doc { return Concat(Line, ConcatSpace(sep, NestT(Group(a)))) },
72 nested[1:]...))
73 }
74}
75
76// ConcatDoc concatenates two Docs with between.
77func ConcatDoc(a, b, between Doc) Doc {

Callers 4

joinNestedOuterMethod · 0.92
docMethod · 0.92
docMethod · 0.92
JoinNestedOuterFunction · 0.85

Calls 5

FoldMapFunction · 0.85
ConcatSpaceFunction · 0.85
NestTFunction · 0.85
GroupFunction · 0.85
ConcatFunction · 0.70

Tested by

no test coverage detected