- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 48 for BlockStmt (0.12 sec)
-
src/go/types/labels.go
package types import ( "go/ast" "go/token" . "internal/types/errors" ) // labels checks correct label use in body. func (check *Checker) labels(body *ast.BlockStmt) { // set of all labels in this body all := NewScope(nil, body.Pos(), body.End(), "label") fwdJumps := check.blockBranches(all, nil, nil, body.List) // If there are any forward jumps left, no label was found for
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 7.2K bytes - Viewed (0) -
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) -
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) -
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) -
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) -
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) -
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) -
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) -
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) -
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)