- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 20 for forStmt (2.06 sec)
-
src/cmd/vendor/golang.org/x/tools/go/cfg/builder.go
case *ast.SwitchStmt: b.switchStmt(s, label) case *ast.TypeSwitchStmt: b.typeSwitchStmt(s, label) case *ast.SelectStmt: b.selectStmt(s, label) case *ast.ForStmt: b.forStmt(s, label) case *ast.RangeStmt: b.rangeStmt(s, label) default: panic(fmt.Sprintf("unexpected statement kind: %T", s)) } } func (b *builder) stmtList(list []ast.Stmt) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 11.4K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/loopclosure/loopclosure.go
} func run(pass *analysis.Pass) (interface{}, error) { inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) nodeFilter := []ast.Node{ (*ast.File)(nil), (*ast.RangeStmt)(nil), (*ast.ForStmt)(nil), } inspect.Nodes(nodeFilter, func(n ast.Node, push bool) bool { if !push { // inspect.Nodes is slightly suboptimal as we only use push=true. return true }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 10.3K bytes - Viewed (0) -
src/cmd/compile/internal/rangefunc/rewrite.go
} return r.useObj(r.nextVar) } // forRangeFunc checks whether n is a range-over-func. // If so, it returns n.(*syntax.ForStmt), true. // Otherwise it returns nil, false. func forRangeFunc(n syntax.Node) (*syntax.ForStmt, bool) { nfor, ok := n.(*syntax.ForStmt) if !ok { return nil, false } nrange, ok := nfor.Init.(*syntax.RangeClause) if !ok { return nil, false }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:05:44 UTC 2024 - 41.6K bytes - Viewed (0) -
src/go/ast/ast.go
} // A SelectStmt node represents a select statement. SelectStmt struct { Select token.Pos // position of "select" keyword Body *BlockStmt // CommClauses only } // A ForStmt represents a for statement. ForStmt struct { For token.Pos // position of "for" keyword Init Stmt // initialization statement; or nil Cond Expr // condition; or nil Post Stmt // post iteration statement; or nil
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 28 21:32:41 UTC 2024 - 35.6K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go
tok(n.Opening, len("(")), // or len("[") tok(n.Closing, len(")"))) // or len("]") case *ast.File: // TODO test: Doc children = append(children, tok(n.Package, len("package"))) case *ast.ForStmt: children = append(children, tok(n.For, len("for"))) case *ast.FuncDecl: // TODO(adonovan): FuncDecl.Comment? // Uniquely, FuncDecl breaks the invariant that
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 18 21:28:13 UTC 2023 - 15.9K bytes - Viewed (0) -
src/go/parser/parser_test.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jan 31 20:26:14 UTC 2024 - 24.6K bytes - Viewed (0) -
src/cmd/cover/cover.go
case *ast.IfStmt: found, pos := hasFuncLiteral(s.Init) if found { return pos } found, pos = hasFuncLiteral(s.Cond) if found { return pos } return s.Body.Lbrace case *ast.ForStmt: found, pos := hasFuncLiteral(s.Init) if found { return pos } found, pos = hasFuncLiteral(s.Cond) if found { return pos } found, pos = hasFuncLiteral(s.Post) if found {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue May 14 19:41:17 UTC 2024 - 34.5K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/internal/analysisinternal/analysis.go
// Check if the enclosing statement is inside another node. switch expr := path[enclosingIndex+1].(type) { case *ast.IfStmt: // Get the base if statement. return baseIfStmt(path, enclosingIndex+1) case *ast.ForStmt: if expr.Init == enclosingStmt || expr.Post == enclosingStmt { return expr } } return enclosingStmt.(ast.Stmt) } // baseIfStmt walks up the if/else-if chain until we get to
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 04 16:19:04 UTC 2024 - 11.7K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go
a.apply(n, "Body", nil, n.Body) case *ast.CommClause: a.apply(n, "Comm", nil, n.Comm) a.applyList(n, "Body") case *ast.SelectStmt: a.apply(n, "Body", nil, n.Body) case *ast.ForStmt: a.apply(n, "Init", nil, n.Init) a.apply(n, "Cond", nil, n.Cond) a.apply(n, "Post", nil, n.Post) a.apply(n, "Body", nil, n.Body) case *ast.RangeStmt: a.apply(n, "Key", nil, n.Key)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 18 21:28:13 UTC 2023 - 12.2K bytes - Viewed (0) -
src/cmd/compile/internal/types2/stmt.go
} check.openScopeUntil(clause, end, "case") if clause.Comm != nil { check.stmt(inner, clause.Comm) } check.stmtList(inner, clause.Body) check.closeScope() } case *syntax.ForStmt: inner |= breakOk | continueOk if rclause, _ := s.Init.(*syntax.RangeClause); rclause != nil { check.rangeStmt(inner, s, rclause) break } check.openScope(s, "for")
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 30.7K bytes - Viewed (0)