(lbl string, d ...pretty.Doc)
| 203 | } |
| 204 | |
| 205 | func (p *PrettyCfg) joinNestedOuter(lbl string, d ...pretty.Doc) pretty.Doc { |
| 206 | if len(d) == 0 { |
| 207 | return pretty.Nil |
| 208 | } |
| 209 | switch p.Align { |
| 210 | case PrettyAlignAndDeindent: |
| 211 | return pretty.JoinNestedOuter(lbl, pretty.Keyword, d...) |
| 212 | case PrettyAlignAndExtraIndent: |
| 213 | items := make([]pretty.TableRow, len(d)) |
| 214 | for i, dd := range d { |
| 215 | if i > 0 { |
| 216 | items[i].Label = lbl |
| 217 | } |
| 218 | items[i].Doc = dd |
| 219 | } |
| 220 | return pretty.Table(pretty.TableRightAlignFirstColumn, pretty.Keyword, items...) |
| 221 | default: |
| 222 | return pretty.JoinNestedRight(pretty.Keyword(lbl), d...) |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | // docer is implemented by nodes that can convert themselves into |
| 227 | // pretty.Docs. If nodes cannot, node.Format is used instead as a Text Doc. |
no test coverage detected