Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 56 for chanType (0.15 sec)

  1. 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)
  2. src/cmd/compile/internal/syntax/printer.go

    		}
    		p.print(_Rbrace)
    
    	case *MapType:
    		p.print(_Map, _Lbrack, n.Key, _Rbrack, n.Value)
    
    	case *ChanType:
    		if n.Dir == RecvOnly {
    			p.print(_Arrow)
    		}
    		p.print(_Chan)
    		if n.Dir == SendOnly {
    			p.print(_Arrow)
    		}
    		p.print(blank)
    		if e, _ := n.Elem.(*ChanType); n.Dir == 0 && e != nil && e.Dir == RecvOnly {
    			// don't print chan (<-chan T) as chan <-chan T
    			p.print(_Lparen)
    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/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/cmd/vendor/golang.org/x/tools/internal/analysisinternal/analysis.go

    		dir := ast.ChanDir(t.Dir())
    		if t.Dir() == types.SendRecv {
    			dir = ast.SEND | ast.RECV
    		}
    		value := TypeExpr(f, pkg, t.Elem())
    		if value == nil {
    			return nil
    		}
    		return &ast.ChanType{
    			Dir:   dir,
    			Value: value,
    		}
    	case *types.Signature:
    		var params []*ast.Field
    		for i := 0; i < t.Params().Len(); i++ {
    			p := TypeExpr(f, pkg, t.Params().At(i).Type())
    			if p == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 11.7K bytes
    - Viewed (0)
  5. src/go/ast/filter.go

    			t.Incomplete = true
    		}
    		return len(t.Methods.List) > 0
    	case *MapType:
    		b1 := filterType(t.Key, f, export)
    		b2 := filterType(t.Value, f, export)
    		return b1 || b2
    	case *ChanType:
    		return filterType(t.Value, f, export)
    	}
    	return false
    }
    
    func filterSpec(spec Spec, f Filter, export bool) bool {
    	switch s := spec.(type) {
    	case *ValueSpec:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  6. 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)
  7. src/go/internal/gccgoimporter/parser.go

    	t := new(types.Map)
    	p.update(t, nlist)
    
    	p.expect('[')
    	key := p.parseType(pkg)
    	p.expect(']')
    	elem := p.parseType(pkg)
    
    	*t = *types.NewMap(key, elem)
    	return t
    }
    
    // ChanType = "chan" ["<-" | "-<"] Type .
    func (p *parser) parseChanType(pkg *types.Package, nlist []any) types.Type {
    	p.expectKeyword("chan")
    
    	t := new(types.Chan)
    	p.update(t, nlist)
    
    	dir := types.SendRecv
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 02 23:14:07 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  8. src/cmd/fix/fix.go

    		}
    	case *ast.InterfaceType:
    		walkBeforeAfter(&n.Methods, before, after)
    	case *ast.MapType:
    		walkBeforeAfter(&n.Key, before, after)
    		walkBeforeAfter(&n.Value, before, after)
    	case *ast.ChanType:
    		walkBeforeAfter(&n.Value, before, after)
    
    	case *ast.BadStmt:
    	case *ast.DeclStmt:
    		walkBeforeAfter(&n.Decl, before, after)
    	case *ast.EmptyStmt:
    	case *ast.LabeledStmt:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 14.6K bytes
    - Viewed (0)
  9. src/cmd/cgo/ast.go

    			f.walk(n.Results, ctxParam, visit)
    		}
    	case *ast.InterfaceType:
    		f.walk(n.Methods, ctxField, visit)
    	case *ast.MapType:
    		f.walk(&n.Key, ctxType, visit)
    		f.walk(&n.Value, ctxType, visit)
    	case *ast.ChanType:
    		f.walk(&n.Value, ctxType, visit)
    
    	case *ast.BadStmt:
    	case *ast.DeclStmt:
    		f.walk(n.Decl, ctxDecl, visit)
    	case *ast.EmptyStmt:
    	case *ast.LabeledStmt:
    		f.walk(n.Stmt, 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)
  10. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go

    	case *ast.InterfaceType:
    		a.apply(n, "Methods", nil, n.Methods)
    
    	case *ast.MapType:
    		a.apply(n, "Key", nil, n.Key)
    		a.apply(n, "Value", nil, n.Value)
    
    	case *ast.ChanType:
    		a.apply(n, "Value", nil, n.Value)
    
    	// Statements
    	case *ast.BadStmt:
    		// nothing to do
    
    	case *ast.DeclStmt:
    		a.apply(n, "Decl", nil, n.Decl)
    
    	case *ast.EmptyStmt:
    		// nothing to do
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 12.2K bytes
    - Viewed (0)
Back to top