Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 23 for BlockStmt (0.15 sec)

  1. src/go/ast/ast.go

    		TokPos token.Pos   // position of Tok
    		Tok    token.Token // keyword token (BREAK, CONTINUE, GOTO, FALLTHROUGH)
    		Label  *Ident      // label name; or nil
    	}
    
    	// A BlockStmt node represents a braced statement list.
    	BlockStmt struct {
    		Lbrace token.Pos // position of "{"
    		List   []Stmt
    		Rbrace token.Pos // position of "}", if any (may be absent due to syntax error)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/rangefunc/rewrite.go

    // A rewriter implements rewriting the range-over-funcs in a given function.
    type rewriter struct {
    	pkg   *types2.Package
    	info  *types2.Info
    	sig   *types2.Signature
    	outer *syntax.FuncType
    	body  *syntax.BlockStmt
    
    	// References to important types and values.
    	any   types2.Object
    	bool  types2.Object
    	int   types2.Object
    	true  types2.Object
    	false types2.Object
    
    	// Branch numbering, computed as needed.
    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/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)
  4. 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)
  5. 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)
  6. 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)
  7. src/cmd/fix/fix.go

    var fixes []fix
    
    func register(f fix) {
    	fixes = append(fixes, f)
    }
    
    // walk traverses the AST x, calling visit(y) for each node y in the tree but
    // also with a pointer to each ast.Expr, ast.Stmt, and *ast.BlockStmt,
    // in a bottom-up traversal.
    func walk(x any, visit func(any)) {
    	walkBeforeAfter(x, nop, visit)
    }
    
    func nop(any) {}
    
    // walkBeforeAfter is like walk but calls before(x) before traversing
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 14.6K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/syntax/branches.go

    //   - bad labeled breaks and continues
    //   - invalid, unused, duplicate, and missing labels
    //   - gotos jumping over variable declarations and into blocks
    func checkBranches(body *BlockStmt, errh ErrorHandler) {
    	if body == nil {
    		return
    	}
    
    	// scope of all labels in this body
    	ls := &labelScope{errh: errh}
    	fwdGotos := ls.blockBranches(nil, targets{}, nil, body.Pos(), body.List)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Jun 26 00:21:29 UTC 2022
    - 9.8K bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top