Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 41 for SelectStmt (0.16 sec)

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

    	{"ForStmt", `@for {}`},
    	{"ForStmt", `@for { f() }`},
    	{"SwitchStmt", `@switch {}`},
    	{"SwitchStmt", `@switch { default: }`},
    	{"SwitchStmt", `@switch { default: x++ }`},
    	{"SelectStmt", `@select {}`},
    	{"SelectStmt", `@select { default: }`},
    	{"SelectStmt", `@select { default: ch <- false }`},
    }
    
    var ranges = []test{
    	{"RangeClause", `@range s`},
    	{"RangeClause", `i = @range s`},
    	{"RangeClause", `i := @range s`},
    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.Else != nil &&
    			check.isTerminating(s.Then, "") &&
    			check.isTerminating(s.Else, "") {
    			return true
    		}
    
    	case *syntax.SwitchStmt:
    		return check.isTerminatingSwitch(s.Body, label)
    
    	case *syntax.SelectStmt:
    		for _, cc := range s.Body {
    			if !check.isTerminatingList(cc.Body, "") || hasBreakList(cc.Body, label, true) {
    				return false
    			}
    
    		}
    		return true
    
    	case *syntax.ForStmt:
    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

    			return true
    		}
    
    	case *ast.SwitchStmt:
    		return check.isTerminatingSwitch(s.Body, label)
    
    	case *ast.TypeSwitchStmt:
    		return check.isTerminatingSwitch(s.Body, label)
    
    	case *ast.SelectStmt:
    		for _, s := range s.Body.List {
    			cc := s.(*ast.CommClause)
    			if !check.isTerminatingList(cc.Body, "") || hasBreakList(cc.Body, label, true) {
    				return false
    			}
    
    		}
    		return true
    
    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/vendor/golang.org/x/tools/go/cfg/builder.go

    			b.stmt(s.Else)
    			b.jump(done)
    		}
    
    		b.current = done
    
    	case *ast.SwitchStmt:
    		b.switchStmt(s, label)
    
    	case *ast.TypeSwitchStmt:
    		b.typeSwitchStmt(s, label)
    
    	case *ast.SelectStmt:
    		b.selectStmt(s, label)
    
    	case *ast.ForStmt:
    		b.forStmt(s, label)
    
    	case *ast.RangeStmt:
    		b.rangeStmt(s, label)
    
    	default:
    		panic(fmt.Sprintf("unexpected statement kind: %T", s))
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 11.4K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/syntax/branches.go

    		return invalid
    	}
    	return nil
    }
    
    // targets describes the target statements within which break
    // or continue statements are valid.
    type targets struct {
    	breaks    Stmt     // *ForStmt, *SwitchStmt, *SelectStmt, or nil
    	continues *ForStmt // or nil
    	caseIndex int      // case index of immediately enclosing switch statement, or < 0
    }
    
    // blockBranches processes a block's body starting at start and returns the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Jun 26 00:21:29 UTC 2022
    - 9.8K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/syntax/positions.go

    		// case *DeclStmt:
    		case *AssignStmt:
    			m = n.Lhs
    		// case *BranchStmt:
    		// case *CallStmt:
    		// case *ReturnStmt:
    		// case *IfStmt:
    		// case *ForStmt:
    		// case *SwitchStmt:
    		// case *SelectStmt:
    
    		// helper nodes
    		case *RangeClause:
    			if n.Lhs != nil {
    				m = n.Lhs
    				continue
    			}
    			m = n.X
    		// case *CaseClause:
    		// case *CommClause:
    
    		default:
    			return n.Pos()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 17:49:19 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/labels.go

    				// whose execution terminates."
    				valid := false
    				if t := b.enclosingTarget(name); t != nil {
    					switch t.Stmt.(type) {
    					case *syntax.SwitchStmt, *syntax.SelectStmt, *syntax.ForStmt:
    						valid = true
    					}
    				}
    				if !valid {
    					check.errorf(s.Label, MisplacedLabel, "invalid break label %s", name)
    					return
    				}
    
    			case syntax.Continue:
    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/types/labels.go

    				// whose execution terminates."
    				valid := false
    				if t := b.enclosingTarget(name); t != nil {
    					switch t.Stmt.(type) {
    					case *ast.SwitchStmt, *ast.TypeSwitchStmt, *ast.SelectStmt, *ast.ForStmt, *ast.RangeStmt:
    						valid = true
    					}
    				}
    				if !valid {
    					check.errorf(s.Label, MisplacedLabel, "invalid break label %s", name)
    					return
    				}
    
    			case token.CONTINUE:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unreachable/unreachable.go

    		d.breakTarget = x
    		d.findLabels(x.Body)
    		d.breakTarget = outer
    
    	case *ast.RangeStmt:
    		outer := d.breakTarget
    		d.breakTarget = x
    		d.findLabels(x.Body)
    		d.breakTarget = outer
    
    	case *ast.SelectStmt:
    		outer := d.breakTarget
    		d.breakTarget = x
    		d.findLabels(x.Body)
    		d.breakTarget = outer
    
    	case *ast.SwitchStmt:
    		outer := d.breakTarget
    		d.breakTarget = x
    		d.findLabels(x.Body)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 09 01:28:01 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/syntax/nodes.go

    		Label *Name
    		// Target is the continuation of the control flow after executing
    		// the branch; it is computed by the parser if CheckBranches is set.
    		// Target is a *LabeledStmt for gotos, and a *SwitchStmt, *SelectStmt,
    		// or *ForStmt for breaks and continues, depending on the context of
    		// the branch. Target is not set for fallthroughs.
    		Target Stmt
    		stmt
    	}
    
    	CallStmt struct {
    		Tok     token // Go or Defer
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 14:52:38 UTC 2023
    - 9K bytes
    - Viewed (0)
Back to top