- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 24 for forStmt (0.12 sec)
-
src/cmd/compile/internal/syntax/branches.go
} return nil } // targets describes the target statements within which break // or continue statements are valid. type targets struct { breaks Stmt // *ForStmt, *SwitchStmt, *SelectStmt, or nil continues *ForStmt // or nil caseIndex int // case index of immediately enclosing switch statement, or < 0 } // blockBranches processes a block's body starting at start and returns the
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Sun Jun 26 00:21:29 UTC 2022 - 9.8K bytes - Viewed (0) -
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/cgo/ast.go
f.walk(n.Body, ctxTypeSwitch, visit) case *ast.CommClause: f.walk(n.Comm, ctxStmt, visit) f.walk(n.Body, ctxStmt, visit) case *ast.SelectStmt: f.walk(n.Body, ctxStmt, visit) case *ast.ForStmt: f.walk(n.Init, ctxStmt, visit) f.walk(&n.Cond, ctxExpr, visit) f.walk(n.Post, ctxStmt, visit) f.walk(n.Body, ctxStmt, visit) case *ast.RangeStmt: f.walk(&n.Key, ctxExpr, visit)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jun 07 16:54:27 UTC 2023 - 14.3K bytes - Viewed (0)