Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for chanType (0.15 sec)

  1. src/go/parser/parser.go

    	key := p.parseType()
    	p.expect(token.RBRACK)
    	value := p.parseType()
    
    	return &ast.MapType{Map: pos, Key: key, Value: value}
    }
    
    func (p *parser) parseChanType() *ast.ChanType {
    	if p.trace {
    		defer un(trace(p, "ChanType"))
    	}
    
    	pos := p.pos
    	dir := ast.SEND | ast.RECV
    	var arrow token.Pos
    	if p.tok == token.CHAN {
    		p.next()
    		if p.tok == token.ARROW {
    			arrow = p.pos
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 20:07:50 UTC 2023
    - 72.2K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/syntax/parser.go

    		// the channel type parsed already:
    		//
    		//   <-(chan E)   =>  (<-chan E)
    		//   <-(chan<-E)  =>  (<-chan (<-E))
    
    		if _, ok := x.(*ChanType); ok {
    			// x is a channel type => re-associate <-
    			dir := SendOnly
    			t := x
    			for dir == SendOnly {
    				c, ok := t.(*ChanType)
    				if !ok {
    					break
    				}
    				dir = c.Dir
    				if dir == RecvOnly {
    					// t is type <-chan E but <-<-chan E is not permitted
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 62.9K bytes
    - Viewed (0)
  3. src/go/printer/testdata/parser.go

    	p.expect(token.LBRACK)
    	key := p.parseType()
    	p.expect(token.RBRACK)
    	value := p.parseType()
    
    	return &ast.MapType{pos, key, value}
    }
    
    func (p *parser) parseChanType() *ast.ChanType {
    	if p.trace {
    		defer un(trace(p, "ChanType"))
    	}
    
    	pos := p.pos
    	dir := ast.SEND | ast.RECV
    	if p.tok == token.CHAN {
    		p.next()
    		if p.tok == token.ARROW {
    			p.next()
    			dir = ast.SEND
    		}
    	} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 20:19:51 UTC 2023
    - 50.5K bytes
    - Viewed (0)
  4. src/reflect/type.go

    	BothDir = RecvDir | SendDir             // chan
    )
    
    // arrayType represents a fixed array type.
    type arrayType = abi.ArrayType
    
    // chanType represents a channel type.
    type chanType = abi.ChanType
    
    // funcType represents a function type.
    //
    // A *rtype for each in and out parameter is stored in an array that
    // directly follows the funcType (and possibly its uncommonType). So
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 85.5K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types/type.go

    }
    
    // Chan contains Type fields specific to channel types.
    type Chan struct {
    	Elem *Type   // element type
    	Dir  ChanDir // channel direction
    }
    
    // chanType returns t's extra channel-specific fields.
    func (t *Type) chanType() *Chan {
    	t.wantEtype(TCHAN)
    	return t.extra.(*Chan)
    }
    
    type Tuple struct {
    	first  *Type
    	second *Type
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 49.5K bytes
    - Viewed (0)
  6. src/go/printer/nodes.go

    func isTypeElem(x ast.Expr) bool {
    	switch x := x.(type) {
    	case *ast.ArrayType, *ast.StructType, *ast.FuncType, *ast.InterfaceType, *ast.MapType, *ast.ChanType:
    		return true
    	case *ast.UnaryExpr:
    		return x.Op == token.TILDE
    	case *ast.BinaryExpr:
    		return isTypeElem(x.X) || isTypeElem(x.Y)
    	case *ast.ParenExpr:
    		return isTypeElem(x.X)
    	}
    	return false
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 17 18:53:17 UTC 2023
    - 52.6K bytes
    - Viewed (0)
  7. src/go/types/expr.go

    		*ast.IndexExpr,
    		*ast.SliceExpr,
    		*ast.TypeAssertExpr,
    		*ast.StarExpr,
    		*ast.KeyValueExpr,
    		*ast.ArrayType,
    		*ast.StructType,
    		*ast.FuncType,
    		*ast.InterfaceType,
    		*ast.MapType,
    		*ast.ChanType:
    		// These expression are never untyped - nothing to do.
    		// The respective sub-expressions got their final types
    		// upon assignment or use.
    		if debug {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 49.7K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/expr.go

    		*syntax.ListExpr,
    		//*syntax.StarExpr,
    		*syntax.KeyValueExpr,
    		*syntax.ArrayType,
    		*syntax.StructType,
    		*syntax.FuncType,
    		*syntax.InterfaceType,
    		*syntax.MapType,
    		*syntax.ChanType:
    		// These expression are never untyped - nothing to do.
    		// The respective sub-expressions got their final types
    		// upon assignment or use.
    		if debug {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 51.7K bytes
    - Viewed (0)
  9. src/cmd/cgo/gcc.go

    		// type that contains a pointer.
    		if unionWithPointer[t.X] {
    			return true
    		}
    		return p.hasPointer(f, t.X, false)
    	case *ast.FuncType, *ast.InterfaceType, *ast.MapType, *ast.ChanType:
    		return true
    	case *ast.Ident:
    		// TODO: Handle types defined within function.
    		for _, d := range p.Decl {
    			gd, ok := d.(*ast.GenDecl)
    			if !ok || gd.Tok != token.TYPE {
    				continue
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 15:50:06 UTC 2024
    - 97K bytes
    - Viewed (0)
  10. src/cmd/link/internal/ld/dwarf.go

    	}
    
    	// Needed by the prettyprinter code for interface inspection.
    	for _, typ := range []string{
    		"type:internal/abi.Type",
    		"type:internal/abi.ArrayType",
    		"type:internal/abi.ChanType",
    		"type:internal/abi.FuncType",
    		"type:internal/abi.MapType",
    		"type:internal/abi.PtrType",
    		"type:internal/abi.SliceType",
    		"type:internal/abi.StructType",
    		"type:internal/abi.InterfaceType",
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 16:25:18 UTC 2024
    - 72.4K bytes
    - Viewed (0)
Back to top