Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 29 for BlockStmt (0.14 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/cfg/cfg.go

    type BlockKind uint8
    
    const (
    	KindInvalid BlockKind = iota // Stmt=nil
    
    	KindUnreachable     // unreachable block after {Branch,Return}Stmt / no-return call ExprStmt
    	KindBody            // function body BlockStmt
    	KindForBody         // body of ForStmt
    	KindForDone         // block after ForStmt
    	KindForLoop         // head of ForStmt
    	KindForPost         // post condition of ForStmt
    	KindIfDone          // block after IfStmt
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  2. src/cmd/cover/cover.go

    		// we inserted above.
    		pos := f.fset.File(n.Body.End()).Pos(elseOffset + 4)
    		switch stmt := n.Else.(type) {
    		case *ast.IfStmt:
    			block := &ast.BlockStmt{
    				Lbrace: pos,
    				List:   []ast.Stmt{stmt},
    				Rbrace: stmt.End(),
    			}
    			n.Else = block
    		case *ast.BlockStmt:
    			stmt.Lbrace = pos
    		default:
    			panic("unexpected node type in if")
    		}
    		ast.Walk(f, n.Else)
    		return nil
    	case *ast.SelectStmt:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 19:41:17 UTC 2024
    - 34.5K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/loopclosure/loopclosure.go

    		addVar := func(expr ast.Expr) {
    			if id, _ := expr.(*ast.Ident); id != nil {
    				if obj := pass.TypesInfo.ObjectOf(id); obj != nil {
    					vars = append(vars, obj)
    				}
    			}
    		}
    		var body *ast.BlockStmt
    		switch n := n.(type) {
    		case *ast.File:
    			// Only traverse the file if its goversion is strictly before go1.22.
    			goversion := versions.FileVersion(pass.TypesInfo, n)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/syntax/parser.go

    }
    
    // context must be a non-empty string unless we know that p.tok == _Lbrace.
    func (p *parser) blockStmt(context string) *BlockStmt {
    	if trace {
    		defer p.trace("blockStmt")()
    	}
    
    	s := new(BlockStmt)
    	s.pos = p.pos()
    
    	// people coming from C may forget that braces are mandatory in Go
    	if !p.got(_Lbrace) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 62.9K bytes
    - Viewed (0)
  5. src/go/ast/example_test.go

    	//     19  .  .  .  .  Params: *ast.FieldList {
    	//     20  .  .  .  .  .  Opening: 3:10
    	//     21  .  .  .  .  .  Closing: 3:11
    	//     22  .  .  .  .  }
    	//     23  .  .  .  }
    	//     24  .  .  .  Body: *ast.BlockStmt {
    	//     25  .  .  .  .  Lbrace: 3:13
    	//     26  .  .  .  .  List: []ast.Stmt (len = 1) {
    	//     27  .  .  .  .  .  0: *ast.ExprStmt {
    	//     28  .  .  .  .  .  .  X: *ast.CallExpr {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 21:44:50 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/httpresponse/httpresponse.go

    // node, along with the number of call expressions encountered.
    func restOfBlock(stack []ast.Node) ([]ast.Stmt, int) {
    	var ncalls int
    	for i := len(stack) - 1; i >= 0; i-- {
    		if b, ok := stack[i].(*ast.BlockStmt); ok {
    			for j, v := range b.List {
    				if v == stack[i+1] {
    					return b.List[j:], ncalls
    				}
    			}
    			break
    		}
    
    		if _, ok := stack[i].(*ast.CallExpr); ok {
    			ncalls++
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 5K bytes
    - Viewed (0)
  7. src/go/types/api.go

    	// The Scopes mapping does not contain an entry for the
    	// function body ([*ast.BlockStmt]); the function's scope is
    	// associated with the [*ast.FuncType].
    	//
    	// The following node types may appear in Scopes:
    	//
    	//     *ast.File
    	//     *ast.FuncType
    	//     *ast.TypeSpec
    	//     *ast.BlockStmt
    	//     *ast.IfStmt
    	//     *ast.SwitchStmt
    	//     *ast.TypeSwitchStmt
    	//     *ast.CaseClause
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 19:57:43 UTC 2024
    - 17.2K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/api.go

    	// The Scopes mapping does not contain an entry for the
    	// function body ([*ast.BlockStmt]); the function's scope is
    	// associated with the [*ast.FuncType].
    	//
    	// The following node types may appear in Scopes:
    	//
    	//     *syntax.File
    	//     *syntax.FuncType
    	//     *syntax.TypeDecl
    	//     *syntax.BlockStmt
    	//     *syntax.IfStmt
    	//     *syntax.SwitchStmt
    	//     *syntax.CaseClause
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 13:48:53 UTC 2024
    - 17.4K bytes
    - Viewed (0)
  9. src/go/ast/walk.go

    		Walk(v, n.Call)
    
    	case *DeferStmt:
    		Walk(v, n.Call)
    
    	case *ReturnStmt:
    		walkList(v, n.Results)
    
    	case *BranchStmt:
    		if n.Label != nil {
    			Walk(v, n.Label)
    		}
    
    	case *BlockStmt:
    		walkList(v, n.List)
    
    	case *IfStmt:
    		if n.Init != nil {
    			Walk(v, n.Init)
    		}
    		Walk(v, n.Cond)
    		Walk(v, n.Body)
    		if n.Else != nil {
    			Walk(v, n.Else)
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:34:10 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  10. src/go/types/stmt.go

    package types
    
    import (
    	"go/ast"
    	"go/constant"
    	"go/token"
    	"internal/buildcfg"
    	. "internal/types/errors"
    	"sort"
    )
    
    func (check *Checker) funcBody(decl *declInfo, name string, sig *Signature, body *ast.BlockStmt, iota constant.Value) {
    	if check.conf.IgnoreFuncBodies {
    		panic("function body not ignored")
    	}
    
    	if check.conf._Trace {
    		check.trace(body.Pos(), "-- %s: %s", name, sig)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.6K bytes
    - Viewed (0)
Back to top