(p *PrettyCfg)
| 1297 | } |
| 1298 | |
| 1299 | func (node *CaseExpr) doc(p *PrettyCfg) pretty.Doc { |
| 1300 | d := make([]pretty.Doc, 0, len(node.Whens)+3) |
| 1301 | c := pretty.Keyword("CASE") |
| 1302 | if node.Expr != nil { |
| 1303 | c = pretty.Group(pretty.ConcatSpace(c, p.Doc(node.Expr))) |
| 1304 | } |
| 1305 | d = append(d, c) |
| 1306 | for _, when := range node.Whens { |
| 1307 | d = append(d, p.Doc(when)) |
| 1308 | } |
| 1309 | if node.Else != nil { |
| 1310 | d = append(d, pretty.Group(pretty.ConcatSpace( |
| 1311 | pretty.Keyword("ELSE"), |
| 1312 | p.Doc(node.Else), |
| 1313 | ))) |
| 1314 | } |
| 1315 | d = append(d, pretty.Keyword("END")) |
| 1316 | return pretty.Stack(d...) |
| 1317 | } |
| 1318 | |
| 1319 | func (node *When) doc(p *PrettyCfg) pretty.Doc { |
| 1320 | return pretty.Group(pretty.ConcatLine( |
nothing calls this directly
no test coverage detected