diff options
Diffstat (limited to 'src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/gopherjs/gopherjs/compiler/astutil/astutil.go')
-rw-r--r-- | src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/gopherjs/gopherjs/compiler/astutil/astutil.go | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/gopherjs/gopherjs/compiler/astutil/astutil.go b/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/gopherjs/gopherjs/compiler/astutil/astutil.go deleted file mode 100644 index 7cd93b3ddc1..00000000000 --- a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/gopherjs/gopherjs/compiler/astutil/astutil.go +++ /dev/null @@ -1,48 +0,0 @@ -package astutil - -import ( - "go/ast" - "go/types" -) - -func RemoveParens(e ast.Expr) ast.Expr { - for { - p, isParen := e.(*ast.ParenExpr) - if !isParen { - return e - } - e = p.X - } -} - -func SetType(info *types.Info, t types.Type, e ast.Expr) ast.Expr { - info.Types[e] = types.TypeAndValue{Type: t} - return e -} - -func NewIdent(name string, t types.Type, info *types.Info, pkg *types.Package) *ast.Ident { - ident := ast.NewIdent(name) - info.Types[ident] = types.TypeAndValue{Type: t} - obj := types.NewVar(0, pkg, name, t) - info.Uses[ident] = obj - return ident -} - -func IsTypeExpr(expr ast.Expr, info *types.Info) bool { - switch e := expr.(type) { - case *ast.ArrayType, *ast.ChanType, *ast.FuncType, *ast.InterfaceType, *ast.MapType, *ast.StructType: - return true - case *ast.StarExpr: - return IsTypeExpr(e.X, info) - case *ast.Ident: - _, ok := info.Uses[e].(*types.TypeName) - return ok - case *ast.SelectorExpr: - _, ok := info.Uses[e.Sel].(*types.TypeName) - return ok - case *ast.ParenExpr: - return IsTypeExpr(e.X, info) - default: - return false - } -} |