Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileRewriter ¶
type FileRewriter struct { Original *ast.File Wrapper *ast.File // contains filtered or unexported fields }
FileRewriter is the context of rewriting process
func (*FileRewriter) RewriteReturnVars ¶
RewriteReturnVars handles a case like this
```go func before(a struct { b, c, d int }) (r int)
func after(a struct { b, c, d int }, r *int) ```
func (*FileRewriter) RewriteforTranspiler ¶
func (fr *FileRewriter) RewriteforTranspiler() ast.Node
RewriteforTranspiler outputs an ast.File that fits into transpiler
type Rewriter ¶
type Rewriter struct { Fset *token.FileSet Files map[string]*FileRewriter }
Rewriter provides a shared context for all rewriting
func NewRewritter ¶
NewRewritter creates a new Rewriter object if `fset` is `nil`, then create a new one
func (*Rewriter) NewFileRewritter ¶
func (r *Rewriter) NewFileRewritter(inputfile string) *FileRewriter
NewFileRewritter creates a FileRewriter for specific file
Click to show internal directories.
Click to hide internal directories.