MCPcopy Create free account
hub / github.com/dolthub/doltgresql / Format

Method Format

postgres/parser/sem/tree/expr.go:1605–1619  ·  view source on GitHub ↗

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

1603
1604// Format implements the NodeFormatter interface.
1605func (node *AnnotateTypeExpr) Format(ctx *FmtCtx) {
1606 switch node.SyntaxMode {
1607 case AnnotateShort:
1608 exprFmtWithParen(ctx, node.Expr)
1609 ctx.WriteString(":::")
1610 ctx.FormatTypeReference(node.Type)
1611
1612 default:
1613 ctx.WriteString("ANNOTATE_TYPE(")
1614 ctx.FormatNode(node.Expr)
1615 ctx.WriteString(", ")
1616 ctx.FormatTypeReference(node.Type)
1617 ctx.WriteByte(')')
1618 }
1619}
1620
1621// TypedInnerExpr returns the AnnotateTypeExpr's inner expression as a TypedExpr.
1622func (node *AnnotateTypeExpr) TypedInnerExpr() TypedExpr {

Callers

nothing calls this directly

Calls 4

exprFmtWithParenFunction · 0.85
WriteStringMethod · 0.80
FormatTypeReferenceMethod · 0.80
FormatNodeMethod · 0.80

Tested by

no test coverage detected