Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 40 for forStmt (0.7 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. src/cmd/compile/internal/syntax/parser.go

    	s := new(DeclStmt)
    	s.pos = p.pos()
    
    	p.next() // _Const, _Type, or _Var
    	s.DeclList = p.appendGroup(nil, f)
    
    	return s
    }
    
    func (p *parser) forStmt() Stmt {
    	if trace {
    		defer p.trace("forStmt")()
    	}
    
    	s := new(ForStmt)
    	s.pos = p.pos()
    
    	s.Init, s.Cond, s.Post = p.header(_For)
    	s.Body = p.blockStmt("for clause")
    
    	return s
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 62.9K bytes
    - Viewed (0)
  10. 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)
Back to top