JoinNestedRight nests nested with string s. Every item after the first is indented. For example: aaaa bbb bbb ccc ccc
(sep Doc, nested ...Doc)
| 59 | // |
| 60 | // ccc |
| 61 | func 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. |
| 77 | func ConcatDoc(a, b, between Doc) Doc { |
no test coverage detected