| 115 | } |
| 116 | |
| 117 | func (p *PrettyCfg) bracketKeyword( |
| 118 | leftKeyword, leftParen string, inner pretty.Doc, rightParen, rightKeyword string, |
| 119 | ) pretty.Doc { |
| 120 | var left, right pretty.Doc |
| 121 | if leftKeyword != "" { |
| 122 | left = p.keywordWithText("", leftKeyword, leftParen) |
| 123 | } else { |
| 124 | left = pretty.Text(leftParen) |
| 125 | } |
| 126 | if rightKeyword != "" { |
| 127 | right = p.keywordWithText(rightParen, rightKeyword, "") |
| 128 | } else { |
| 129 | right = pretty.Text(rightParen) |
| 130 | } |
| 131 | return p.bracketDoc(left, inner, right) |
| 132 | } |
| 133 | |
| 134 | // Pretty pretty prints stmt with default options. |
| 135 | func Pretty(stmt NodeFormatter) string { |