Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for CommClause (0.26 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/cfg/builder.go

    	for _, clause := range s.Body.List {
    		if comm := clause.(*ast.CommClause).Comm; comm != nil {
    			b.stmt(comm)
    		}
    	}
    
    	done := b.newBlock(KindSelectDone, s)
    	if label != nil {
    		label._break = done
    	}
    
    	var defaultBody *[]ast.Stmt
    	for _, cc := range s.Body.List {
    		clause := cc.(*ast.CommClause)
    		if clause.Comm == nil {
    			defaultBody = &clause.Body
    			continue
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 11.4K bytes
    - Viewed (0)
  2. src/go/ast/ast.go

    		Init   Stmt       // initialization statement; or nil
    		Assign Stmt       // x := y.(type) or y.(type)
    		Body   *BlockStmt // CaseClauses only
    	}
    
    	// A CommClause node represents a case of a select statement.
    	CommClause struct {
    		Case  token.Pos // position of "case" or "default" keyword
    		Comm  Stmt      // send or receive statement; nil means default case
    		Colon token.Pos // position of ":"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go

    		case ast.SEND:
    			children = append(children, tok(n.Begin, len("chan<-")))
    		case ast.RECV | ast.SEND:
    			children = append(children, tok(n.Begin, len("chan")))
    		}
    
    	case *ast.CommClause:
    		if n.Comm == nil {
    			children = append(children,
    				tok(n.Case, len("default")))
    		} else {
    			children = append(children,
    				tok(n.Case, len("case")))
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 15.9K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/syntax/printer.go

    		p.print(newline)
    		for i, c := range list {
    			p.printCaseClause(c, i+1 == len(list))
    			p.print(newline)
    		}
    	}
    	p.print(_Rbrace)
    }
    
    func (p *printer) printSelectBody(list []*CommClause) {
    	p.print(_Lbrace)
    	if len(list) > 0 {
    		p.print(newline)
    		for i, c := range list {
    			p.printCommClause(c, i+1 == len(list))
    			p.print(newline)
    		}
    	}
    	p.print(_Rbrace)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 24 07:17:27 UTC 2023
    - 21.5K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/loopclosure/loopclosure.go

    	case *ast.TypeSwitchStmt:
    		for _, c := range s.Body.List {
    			cc := c.(*ast.CaseClause)
    			forEachLastStmt(cc.Body, onLast)
    		}
    	case *ast.SelectStmt:
    		for _, c := range s.Body.List {
    			cc := c.(*ast.CommClause)
    			forEachLastStmt(cc.Body, onLast)
    		}
    	default:
    		onLast(s)
    	}
    }
    
    // litStmts returns all statements from the function body of a function
    // literal.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  6. src/go/types/stmt.go

    	var first ast.Stmt
    	for _, s := range list {
    		var d ast.Stmt
    		switch c := s.(type) {
    		case *ast.CaseClause:
    			if len(c.List) == 0 {
    				d = s
    			}
    		case *ast.CommClause:
    			if c.Comm == nil {
    				d = s
    			}
    		default:
    			check.error(s, InvalidSyntaxTree, "case/communication clause expected")
    		}
    		if d != nil {
    			if first != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.6K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/stmt.go

    				// TODO(gri) probably ok to bail out after first error (and simplify this code)
    			} else {
    				first = c
    			}
    		}
    	}
    }
    
    func (check *Checker) multipleSelectDefaults(list []*syntax.CommClause) {
    	var first *syntax.CommClause
    	for _, c := range list {
    		if c.Comm == nil {
    			if first != nil {
    				check.errorf(c, DuplicateDefault, "multiple defaults (first at %s)", first.Pos())
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.7K bytes
    - Viewed (0)
  8. src/cmd/cgo/ast.go

    		f.walk(&n.Tag, ctxExpr, visit)
    		f.walk(n.Body, ctxSwitch, visit)
    	case *ast.TypeSwitchStmt:
    		f.walk(n.Init, ctxStmt, visit)
    		f.walk(n.Assign, ctxStmt, visit)
    		f.walk(n.Body, ctxTypeSwitch, visit)
    	case *ast.CommClause:
    		f.walk(n.Comm, ctxStmt, visit)
    		f.walk(n.Body, ctxStmt, visit)
    	case *ast.SelectStmt:
    		f.walk(n.Body, ctxStmt, visit)
    	case *ast.ForStmt:
    		f.walk(n.Init, ctxStmt, visit)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 07 16:54:27 UTC 2023
    - 14.3K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go

    		a.apply(n, "Body", nil, n.Body)
    
    	case *ast.TypeSwitchStmt:
    		a.apply(n, "Init", nil, n.Init)
    		a.apply(n, "Assign", nil, n.Assign)
    		a.apply(n, "Body", nil, n.Body)
    
    	case *ast.CommClause:
    		a.apply(n, "Comm", nil, n.Comm)
    		a.applyList(n, "Body")
    
    	case *ast.SelectStmt:
    		a.apply(n, "Body", nil, n.Body)
    
    	case *ast.ForStmt:
    		a.apply(n, "Init", nil, n.Init)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 12.2K bytes
    - Viewed (0)
  10. src/cmd/cover/cover.go

    					clause := n.(*ast.CaseClause)
    					f.addCounters(clause.Colon+1, clause.Colon+1, clause.End(), clause.Body, false)
    				}
    				return f
    			case *ast.CommClause: // select
    				for _, n := range n.List {
    					clause := n.(*ast.CommClause)
    					f.addCounters(clause.Colon+1, clause.Colon+1, clause.End(), clause.Body, false)
    				}
    				return f
    			}
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 19:41:17 UTC 2024
    - 34.5K bytes
    - Viewed (0)
Back to top