Namespace: go.std.go.printer
v1.0Contents
Summary
Provides a low-level interface to the go/printer package.
Package printer implements printing of AST nodes.
Index
- *CommentedNode
- *Config
- *Mode
- CommentedNode
- Config
- Fprint
- Mode
- RawFormat
- SourcePos
- TabIndent
- UseSpaces
- arrayOfCommentedNode
- arrayOfConfig
- arrayOfMode
Legend
-
Constant
Variable
Function
Macro
Special form
Type
GoVar
Receiver/Method
Constants
Constants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.-
(None.)
Variables
-
RawFormat
GoObject v1.0do not use a tabwriter; if set, UseSpaces is ignored
-
SourcePos
GoObject v1.0emit //line directives to preserve original source positions
-
TabIndent
GoObject v1.0use tabs for indentation independent of UseSpaces
-
UseSpaces
GoObject v1.0use spaces instead of tabs for alignment
Functions, Macros, and Special Forms
-
Fprint
Function v1.0(Fprint output fset node)
Fprint "pretty-prints" an AST node to output.
It calls Config.Fprint with default settings.
Note that gofmt uses tabs for indentation but spaces for alignment;
use format.Node (package go/format) for output that matches gofmt.
Go input arguments: (output io.Writer, fset *go/token.FileSet, node any)
Go returns: error
Joker input arguments: [^go.std.io/Writer output, ^go.std.go.token/*FileSet fset, ^GoObject node]
Joker returns: ^Error
Types
-
*CommentedNode
Concrete Type v1.0A CommentedNode bundles an AST node and corresponding comments.
It may be provided as argument to any of the Fprint functions.
-
*Config
Concrete Type v1.0A Config node controls the output of Fprint.
-
Fprint
Receiver for *Config v1.0([output fset node])
Fprint "pretty-prints" an AST node to output for a given configuration cfg.
Position information is interpreted relative to the file set fset.
The node type must be *ast.File, *CommentedNode, []ast.Decl, []ast.Stmt,
or assignment-compatible to ast.Expr, ast.Decl, ast.Spec, or ast.Stmt.
-
*Mode
Concrete Type v1.0A Mode value is a set of flags (or 0). They control printing.
-
CommentedNode
Concrete Type v1.0A CommentedNode bundles an AST node and corresponding comments.
It may be provided as argument to any of the Fprint functions.
-
Config
Concrete Type v1.0A Config node controls the output of Fprint.
-
Mode
Concrete Type v1.0A Mode value is a set of flags (or 0). They control printing.
-
arrayOfCommentedNode
Concrete Type v1.0A CommentedNode bundles an AST node and corresponding comments.
It may be provided as argument to any of the Fprint functions.
-
arrayOfConfig
Concrete Type v1.0A Config node controls the output of Fprint.
-
arrayOfMode
Concrete Type v1.0A Mode value is a set of flags (or 0). They control printing.