Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for declStmt (0.13 sec)

  1. src/cmd/compile/internal/syntax/nodes_test.go

    	{"ExprStmt", `append@(s, 1, 2, 3)`},
    
    	{"SendStmt", `ch @<- x`},
    
    	{"DeclStmt", `@const x = 0`},
    	{"DeclStmt", `@const (x = 0)`},
    	{"DeclStmt", `@type T int`},
    	{"DeclStmt", `@type T = int`},
    	{"DeclStmt", `@type (T1 = int; T2 = float32)`},
    	{"DeclStmt", `@var x = 0`},
    	{"DeclStmt", `@var x, y, z int`},
    	{"DeclStmt", `@var (a, b = 1, 2)`},
    
    	{"AssignStmt", `x @= y`},
    	{"AssignStmt", `a, b, x @= 1, 2, 3`},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 02 18:45:06 UTC 2023
    - 8.7K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/return.go

    // If s is labeled, label is the label name; otherwise s
    // is "".
    func (check *Checker) isTerminating(s syntax.Stmt, label string) bool {
    	switch s := s.(type) {
    	default:
    		panic("unreachable")
    
    	case *syntax.DeclStmt, *syntax.EmptyStmt, *syntax.SendStmt,
    		*syntax.AssignStmt, *syntax.CallStmt:
    		// no chance
    
    	case *syntax.LabeledStmt:
    		return check.isTerminating(s.Stmt, s.Label.Value)
    
    	case *syntax.ExprStmt:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  3. src/go/types/return.go

    // If s is labeled, label is the label name; otherwise s
    // is "".
    func (check *Checker) isTerminating(s ast.Stmt, label string) bool {
    	switch s := s.(type) {
    	default:
    		panic("unreachable")
    
    	case *ast.BadStmt, *ast.DeclStmt, *ast.EmptyStmt, *ast.SendStmt,
    		*ast.IncDecStmt, *ast.AssignStmt, *ast.GoStmt, *ast.DeferStmt,
    		*ast.RangeStmt:
    		// no chance
    
    	case *ast.LabeledStmt:
    		return check.isTerminating(s.Stmt, s.Label.Name)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/syntax/positions.go

    		// case *MapType:
    		// case *ChanType:
    
    		// statements
    		// case *EmptyStmt:
    		// case *LabeledStmt:
    		// case *BlockStmt:
    		// case *ExprStmt:
    		case *SendStmt:
    			m = n.Chan
    		// case *DeclStmt:
    		case *AssignStmt:
    			m = n.Lhs
    		// case *BranchStmt:
    		// case *CallStmt:
    		// case *ReturnStmt:
    		// case *IfStmt:
    		// case *ForStmt:
    		// case *SwitchStmt:
    		// case *SelectStmt:
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 17:49:19 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unreachable/unreachable.go

    	switch x := stmt.(type) {
    	default:
    		log.Fatalf("%s: internal error in findLabels: unexpected statement %T", d.pass.Fset.Position(x.Pos()), x)
    
    	case *ast.AssignStmt,
    		*ast.BadStmt,
    		*ast.DeclStmt,
    		*ast.DeferStmt,
    		*ast.EmptyStmt,
    		*ast.ExprStmt,
    		*ast.GoStmt,
    		*ast.IncDecStmt,
    		*ast.ReturnStmt,
    		*ast.SendStmt:
    		// no statements inside
    
    	case *ast.BlockStmt:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 09 01:28:01 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/go/ast/inspector/typeof.go

    		return 1 << nCommClause
    	case *ast.Comment:
    		return 1 << nComment
    	case *ast.CommentGroup:
    		return 1 << nCommentGroup
    	case *ast.CompositeLit:
    		return 1 << nCompositeLit
    	case *ast.DeclStmt:
    		return 1 << nDeclStmt
    	case *ast.DeferStmt:
    		return 1 << nDeferStmt
    	case *ast.Ellipsis:
    		return 1 << nEllipsis
    	case *ast.EmptyStmt:
    		return 1 << nEmptyStmt
    	case *ast.ExprStmt:
    		return 1 << nExprStmt
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  7. src/go/types/labels.go

    		fwdJumps = append(fwdJumps, check.blockBranches(all, b, lstmt, list)...)
    	}
    
    	var stmtBranches func(ast.Stmt)
    	stmtBranches = func(s ast.Stmt) {
    		switch s := s.(type) {
    		case *ast.DeclStmt:
    			if d, _ := s.Decl.(*ast.GenDecl); d != nil && d.Tok == token.VAR {
    				recordVarDecl(d.Pos())
    			}
    
    		case *ast.LabeledStmt:
    			// declare non-blank label
    			if name := s.Label.Name; name != "_" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  8. src/go/ast/walk.go

    		Walk(v, n.Methods)
    
    	case *MapType:
    		Walk(v, n.Key)
    		Walk(v, n.Value)
    
    	case *ChanType:
    		Walk(v, n.Value)
    
    	// Statements
    	case *BadStmt:
    		// nothing to do
    
    	case *DeclStmt:
    		Walk(v, n.Decl)
    
    	case *EmptyStmt:
    		// nothing to do
    
    	case *LabeledStmt:
    		Walk(v, n.Label)
    		Walk(v, n.Stmt)
    
    	case *ExprStmt:
    		Walk(v, n.X)
    
    	case *SendStmt:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:34:10 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/labels.go

    				if jmp == bad {
    					return true
    				}
    			}
    		}
    		return false
    	}
    
    	var stmtBranches func(syntax.Stmt)
    	stmtBranches = func(s syntax.Stmt) {
    		switch s := s.(type) {
    		case *syntax.DeclStmt:
    			for _, d := range s.DeclList {
    				if d, _ := d.(*syntax.VarDecl); d != nil {
    					recordVarDecl(d.Pos())
    				}
    			}
    
    		case *syntax.LabeledStmt:
    			// declare non-blank label
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/syntax/walk.go

    		w.node(n.Label)
    		w.node(n.Stmt)
    
    	case *BlockStmt:
    		w.stmtList(n.List)
    
    	case *ExprStmt:
    		w.node(n.X)
    
    	case *SendStmt:
    		w.node(n.Chan)
    		w.node(n.Value)
    
    	case *DeclStmt:
    		w.declList(n.DeclList)
    
    	case *AssignStmt:
    		w.node(n.Lhs)
    		if n.Rhs != nil {
    			w.node(n.Rhs)
    		}
    
    	case *BranchStmt:
    		if n.Label != nil {
    			w.node(n.Label)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:55:04 UTC 2023
    - 5.7K bytes
    - Viewed (0)
Back to top