Documentation ¶
Index ¶
- func Decorate(fset *token.FileSet, n ast.Node) dst.Node
- func DecorateFile(fset *token.FileSet, f *ast.File) *dst.File
- func Fprint(w io.Writer, f *dst.File) error
- func Parse(src interface{}) (*dst.File, error)
- func ParseDir(fset *token.FileSet, path string, filter func(os.FileInfo) bool, ...) (map[string]*dst.Package, error)
- func ParseExpr(x string) (dst.Expr, error)
- func ParseExprFrom(fset *token.FileSet, filename string, src interface{}, mode parser.Mode) (dst.Expr, error)
- func ParseFile(fset *token.FileSet, filename string, src interface{}, mode parser.Mode) (*dst.File, error)
- func Print(f *dst.File) error
- func Restore(file *dst.File) (*token.FileSet, *ast.File)
- type AstMap
- type Decorator
- type DstMap
- type Map
- type Restorer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecorateFile ¶ added in v0.1.0
Decorate decorates a *ast.File and returns a *dst.File.
func Parse ¶
Parse uses parser.ParseFile to parse and decorate a Go source file. The src parameter should be string, []byte, or io.Reader.
func ParseDir ¶ added in v0.1.0
func ParseDir(fset *token.FileSet, path string, filter func(os.FileInfo) bool, mode parser.Mode) (map[string]*dst.Package, error)
ParseDir uses parser.ParseDir to parse and decorate a directory containing Go source.
func ParseExpr ¶ added in v0.1.0
ParseExpr uses parser.ParseExpr to parse and decorate a Go expression. It should be noted that this is of limited use because comments are not parsed by parser.ParseExpr.
func ParseExprFrom ¶ added in v0.1.0
func ParseExprFrom(fset *token.FileSet, filename string, src interface{}, mode parser.Mode) (dst.Expr, error)
ParseExprFrom uses parser.ParseExprFrom to parse and decorate a Go expression. It should be noted that this is of limited use because comments are not parsed by parser.ParseExprFrom.
Types ¶
type Decorator ¶ added in v0.1.0
Click to show internal directories.
Click to hide internal directories.