Format implements the NodeFormatter interface.
(ctx *FmtCtx)
| 1603 | |
| 1604 | // Format implements the NodeFormatter interface. |
| 1605 | func (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. |
| 1622 | func (node *AnnotateTypeExpr) TypedInnerExpr() TypedExpr { |
nothing calls this directly
no test coverage detected