Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 49 for forStmt (0.26 sec)

  1. 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)
  2. 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)
  3. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unreachable/unreachable.go

    		d.labels[x.Label.Name] = x.Stmt
    		d.findLabels(x.Stmt)
    
    	// These cases are all the same, but the x.Body only works
    	// when the specific type of x is known, so the cases cannot
    	// be merged.
    	case *ast.ForStmt:
    		outer := d.breakTarget
    		d.breakTarget = x
    		d.findLabels(x.Body)
    		d.breakTarget = outer
    
    	case *ast.RangeStmt:
    		outer := d.breakTarget
    		d.breakTarget = x
    		d.findLabels(x.Body)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 09 01:28:01 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/syntax/nodes.go

    		// Target is the continuation of the control flow after executing
    		// the branch; it is computed by the parser if CheckBranches is set.
    		// Target is a *LabeledStmt for gotos, and a *SwitchStmt, *SelectStmt,
    		// or *ForStmt for breaks and continues, depending on the context of
    		// the branch. Target is not set for fallthroughs.
    		Target Stmt
    		stmt
    	}
    
    	CallStmt struct {
    		Tok     token // Go or Defer
    		Call    Expr
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 14:52:38 UTC 2023
    - 9K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/tools/go/ast/inspector/typeof.go

    	case *ast.ExprStmt:
    		return 1 << nExprStmt
    	case *ast.Field:
    		return 1 << nField
    	case *ast.FieldList:
    		return 1 << nFieldList
    	case *ast.File:
    		return 1 << nFile
    	case *ast.ForStmt:
    		return 1 << nForStmt
    	case *ast.FuncDecl:
    		return 1 << nFuncDecl
    	case *ast.FuncLit:
    		return 1 << nFuncLit
    	case *ast.FuncType:
    		return 1 << nFuncType
    	case *ast.GenDecl:
    		return 1 << nGenDecl
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. src/cmd/compile/internal/syntax/walk.go

    			w.node(n.Results)
    		}
    
    	case *IfStmt:
    		if n.Init != nil {
    			w.node(n.Init)
    		}
    		w.node(n.Cond)
    		w.node(n.Then)
    		if n.Else != nil {
    			w.node(n.Else)
    		}
    
    	case *ForStmt:
    		if n.Init != nil {
    			w.node(n.Init)
    		}
    		if n.Cond != nil {
    			w.node(n.Cond)
    		}
    		if n.Post != nil {
    			w.node(n.Post)
    		}
    		w.node(n.Body)
    
    	case *SwitchStmt:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:55:04 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  9. src/go/parser/parser_test.go

    	{name: "for1", format: "package main; func main() { «for x { «» }» }", scope: true, scopeMultiplier: 2},                          // Scopes: ForStmt, BlockStmt
    	{name: "for3", format: "package main; func main() { «for f(); g(); h() { «» }» }", scope: true, scopeMultiplier: 2},              // Scopes: ForStmt, BlockStmt
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 31 20:26:14 UTC 2024
    - 24.6K bytes
    - Viewed (0)
  10. src/go/ast/walk.go

    		}
    		Walk(v, n.Assign)
    		Walk(v, n.Body)
    
    	case *CommClause:
    		if n.Comm != nil {
    			Walk(v, n.Comm)
    		}
    		walkList(v, n.Body)
    
    	case *SelectStmt:
    		Walk(v, n.Body)
    
    	case *ForStmt:
    		if n.Init != nil {
    			Walk(v, n.Init)
    		}
    		if n.Cond != nil {
    			Walk(v, n.Cond)
    		}
    		if n.Post != nil {
    			Walk(v, n.Post)
    		}
    		Walk(v, n.Body)
    
    	case *RangeStmt:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:34:10 UTC 2024
    - 6.4K bytes
    - Viewed (0)
Back to top