Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 42 for BlockStmt (0.32 sec)

  1. src/go/doc/example.go

    }
    
    // stripOutputComment finds and removes the "Output:" or "Unordered output:"
    // comment from body and comments, and adjusts the body block's end position.
    func stripOutputComment(body *ast.BlockStmt, comments []*ast.CommentGroup) (*ast.BlockStmt, []*ast.CommentGroup) {
    	// Do nothing if there is no "Output:" or "Unordered output:" comment.
    	i, last := lastComment(body, comments)
    	if last == nil || !outputPrefix.MatchString(last.Text()) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 21.4K bytes
    - Viewed (0)
  2. 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)
  3. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go

    // z-assignment statement, because it spans three of its children (:=,
    // x, +).  So too is the 1-char interval D, because it contains only
    // interior whitespace of the assignment.  E is considered interior
    // whitespace of the BlockStmt containing the assignment.
    //
    // The resulting path is never empty; it always contains at least the
    // 'root' *ast.File.  Ideally PathEnclosingInterval would reject
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 15.9K bytes
    - Viewed (0)
  4. 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)
  5. src/go/printer/testdata/parser.go

    	if p.trace {
    		defer un(trace(p, "BlockStmt"))
    	}
    
    	lbrace := p.expect(token.LBRACE)
    	p.openScope()
    	list := p.parseStmtList()
    	p.closeScope()
    	rbrace := p.expect(token.RBRACE)
    
    	return &ast.BlockStmt{lbrace, list, rbrace}
    }
    
    // ----------------------------------------------------------------------------
    // Expressions
    
    func (p *parser) parseFuncTypeOrLit() ast.Expr {
    	if p.trace {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 20:19:51 UTC 2023
    - 50.5K bytes
    - Viewed (0)
  6. 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)
  7. src/cmd/vendor/golang.org/x/tools/go/ast/inspector/typeof.go

    	case *ast.BadExpr:
    		return 1 << nBadExpr
    	case *ast.BadStmt:
    		return 1 << nBadStmt
    	case *ast.BasicLit:
    		return 1 << nBasicLit
    	case *ast.BinaryExpr:
    		return 1 << nBinaryExpr
    	case *ast.BlockStmt:
    		return 1 << nBlockStmt
    	case *ast.BranchStmt:
    		return 1 << nBranchStmt
    	case *ast.CallExpr:
    		return 1 << nCallExpr
    	case *ast.CaseClause:
    		return 1 << nCaseClause
    	case *ast.ChanType:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. src/cmd/compile/internal/walk/stmt.go

    	case ir.OBREAK,
    		ir.OCONTINUE,
    		ir.OFALL,
    		ir.OGOTO,
    		ir.OLABEL,
    		ir.OJUMPTABLE,
    		ir.OINTERFACESWITCH,
    		ir.ODCL,
    		ir.OCHECKNIL:
    		return n
    
    	case ir.OBLOCK:
    		n := n.(*ir.BlockStmt)
    		walkStmtList(n.List)
    		return n
    
    	case ir.OCASE:
    		base.Errorf("case statement out of place")
    		panic("unreachable")
    
    	case ir.ODEFER:
    		n := n.(*ir.GoDeferStmt)
    		ir.CurFunc.SetHasDefer(true)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 06 15:42:30 UTC 2023
    - 4.7K bytes
    - Viewed (0)
Back to top