MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / doc

Method doc

pkg/sql/sem/tree/pretty.go:1299–1317  ·  view source on GitHub ↗
(p *PrettyCfg)

Source from the content-addressed store, hash-verified

1297}
1298
1299func (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
1319func (node *When) doc(p *PrettyCfg) pretty.Doc {
1320 return pretty.Group(pretty.ConcatLine(

Callers

nothing calls this directly

Calls 5

KeywordFunction · 0.92
GroupFunction · 0.92
ConcatSpaceFunction · 0.92
StackFunction · 0.92
DocMethod · 0.80

Tested by

no test coverage detected