Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 17 of 17 for selectStmt (0.19 sec)

  1. src/cmd/compile/internal/typecheck/stmt.go

    	if len(n.Results) != 0 {
    		typecheckaste(ir.ORETURN, nil, false, ir.CurFunc.Type().Results(), n.Results, func() string { return "return argument" })
    	}
    	return n
    }
    
    // select
    func tcSelect(sel *ir.SelectStmt) {
    	var def *ir.CommClause
    	lno := ir.SetPos(sel)
    	Stmts(sel.Init())
    	for _, ncase := range sel.Cases {
    		if ncase.Comm == nil {
    			// default
    			if def != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 20 15:10:54 UTC 2023
    - 17.8K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/syntax/printer.go

    	case *SwitchStmt:
    		p.print(_Switch, blank)
    		if n.Init != nil {
    			p.print(n.Init, _Semi, blank)
    		}
    		if n.Tag != nil {
    			p.print(n.Tag, blank)
    		}
    		p.printSwitchBody(n.Body)
    
    	case *SelectStmt:
    		p.print(_Select, blank) // for now
    		p.printSelectBody(n.Body)
    
    	case *RangeClause:
    		if n.Lhs != nil {
    			tok := _Assign
    			if n.Def {
    				tok = _Define
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 24 07:17:27 UTC 2023
    - 21.5K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/ir/fmt.go

    			}
    			fmt.Fprint(s, " =")
    		}
    		fmt.Fprintf(s, " range %v { %v }", n.X, n.Body)
    		if n.DistinctVars {
    			fmt.Fprint(s, " /* distinct vars */")
    		}
    
    	case OSELECT:
    		n := n.(*SelectStmt)
    		if !exportFormat {
    			fmt.Fprintf(s, "%v statement", n.Op())
    			break
    		}
    		fmt.Fprintf(s, "select { %v }", n.Cases)
    
    	case OSWITCH:
    		n := n.(*SwitchStmt)
    		if !exportFormat {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 15:20:28 UTC 2023
    - 26K bytes
    - Viewed (0)
  4. src/go/types/stmt.go

    				}
    				v.used = true // avoid usage error when checking entire function
    			}
    			if !used {
    				check.softErrorf(lhs, UnusedVar, "%s declared and not used", lhs.Name)
    			}
    		}
    
    	case *ast.SelectStmt:
    		inner |= breakOk
    
    		check.multipleDefaults(s.Body.List)
    
    		for _, s := range s.Body.List {
    			clause, _ := s.(*ast.CommClause)
    			if clause == nil {
    				continue // error reported before
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.6K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/stmt.go

    		check.simpleStmt(s.Init)
    
    		if g, _ := s.Tag.(*syntax.TypeSwitchGuard); g != nil {
    			check.typeSwitchStmt(inner|inTypeSwitch, s, g)
    		} else {
    			check.switchStmt(inner, s)
    		}
    
    	case *syntax.SelectStmt:
    		inner |= breakOk
    
    		check.multipleSelectDefaults(s.Body)
    
    		for i, clause := range s.Body {
    			if clause == nil {
    				continue // error reported before
    			}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.7K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/typecheck/typecheck.go

    		n.Call = typecheck(n.Call, ctxStmt|ctxExpr).(*ir.CallExpr)
    		return n
    
    	case ir.OCHECKNIL:
    		n := n.(*ir.UnaryExpr)
    		return tcCheckNil(n)
    
    	case ir.OSELECT:
    		tcSelect(n.(*ir.SelectStmt))
    		return n
    
    	case ir.OSWITCH:
    		tcSwitch(n.(*ir.SwitchStmt))
    		return n
    
    	case ir.ORANGE:
    		tcRange(n.(*ir.RangeStmt))
    		return n
    
    	case ir.OTYPESW:
    		n := n.(*ir.TypeSwitchGuard)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 20 19:08:34 UTC 2024
    - 30.5K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/walk/order.go

    	// reordered after the channel evaluation for a different
    	// case (if p were nil, then the timing of the fault would
    	// give this away).
    	case ir.OSELECT:
    		n := n.(*ir.SelectStmt)
    		t := o.markTemp()
    		for _, ncas := range n.Cases {
    			r := ncas.Comm
    			ir.SetPos(ncas)
    
    			// Append any new body prologue to ninit.
    			// The next loop will insert ninit into nbody.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 02:00:33 UTC 2024
    - 42.7K bytes
    - Viewed (0)
Back to top