summaryrefslogtreecommitdiff
path: root/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/gopherjs/gopherjs/compiler/analysis/break.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/gopherjs/gopherjs/compiler/analysis/break.go')
-rw-r--r--src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/gopherjs/gopherjs/compiler/analysis/break.go32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/gopherjs/gopherjs/compiler/analysis/break.go b/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/gopherjs/gopherjs/compiler/analysis/break.go
deleted file mode 100644
index 579815d9215..00000000000
--- a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/gopherjs/gopherjs/compiler/analysis/break.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package analysis
-
-import (
- "go/ast"
- "go/token"
-)
-
-func HasBreak(n ast.Node) bool {
- v := hasBreakVisitor{}
- ast.Walk(&v, n)
- return v.hasBreak
-}
-
-type hasBreakVisitor struct {
- hasBreak bool
-}
-
-func (v *hasBreakVisitor) Visit(node ast.Node) (w ast.Visitor) {
- if v.hasBreak {
- return nil
- }
- switch n := node.(type) {
- case *ast.BranchStmt:
- if n.Tok == token.BREAK && n.Label == nil {
- v.hasBreak = true
- return nil
- }
- case *ast.ForStmt, *ast.RangeStmt, *ast.SwitchStmt, *ast.TypeSwitchStmt, *ast.SelectStmt, ast.Expr:
- return nil
- }
- return v
-}