Documentation ¶
Index ¶
- func EndsWithReturn(stmts []ast.Stmt) bool
- func FindLoopStmt(stack []ast.Node, branch *ast.BranchStmt, typeInfo *types.Info) ast.Stmt
- func FuncKey(d *ast.FuncDecl) string
- func ImportsUnsafe(file *ast.File) bool
- func IsTypeExpr(expr ast.Expr, info *types.Info) bool
- func NewIdent(name string, t types.Type, info *types.Info, pkg *types.Package) *ast.Ident
- func PruneOriginal(d *ast.FuncDecl) bool
- func RemoveParens(e ast.Expr) ast.Expr
- func SetType(info *types.Info, t types.Type, e ast.Expr) ast.Expr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EndsWithReturn ¶
EndsWithReturn returns true if the last effective statement is a "return".
func FindLoopStmt ¶
FindLoopStmt tries to find the loop statement among the AST nodes in the |stack| that corresponds to the break/continue statement represented by branch.
This function is label-aware and assumes the code was successfully type-checked.
func FuncKey ¶
FuncKey returns a string, which uniquely identifies a top-level function or method in a package.
func ImportsUnsafe ¶
func PruneOriginal ¶
PruneOriginal returns true if gopherjs:prune-original directive is present before a function decl.
`//gopherjs:prune-original` is a GopherJS-specific directive, which can be applied to functions in native overlays and will instruct the augmentation logic to delete the body of a standard library function that was replaced. This directive can be used to remove code that would be invalid in GopherJS, such as code expecting ints to be 64-bit. It should be used with caution since it may create unused imports in the original source file.
Types ¶
This section is empty.