Search Options

Results per page
Sort
Preferred Languages
Advance

Results 61 - 70 of 102 for MapType (0.35 sec)

  1. src/go/parser/parser.go

    			Closing: rbrace,
    		},
    	}
    }
    
    func (p *parser) parseMapType() *ast.MapType {
    	if p.trace {
    		defer un(trace(p, "MapType"))
    	}
    
    	pos := p.expect(token.MAP)
    	p.expect(token.LBRACK)
    	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 {
    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/go/internal/gccgoimporter/parser.go

    		return t
    	}
    
    	t := new(types.Array)
    	p.update(t, nlist)
    
    	len := p.parseInt64()
    	p.expect(']')
    
    	*t = *types.NewArray(p.parseType(pkg), len)
    	return t
    }
    
    // MapType = "map" "[" Type "]" Type .
    func (p *parser) parseMapType(pkg *types.Package, nlist []any) types.Type {
    	p.expectKeyword("map")
    
    	t := new(types.Map)
    	p.update(t, nlist)
    
    	p.expect('[')
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 02 23:14:07 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/syntax/parser.go

    // The result is false if x could be a type element OR an ordinary (value) expression.
    func isTypeElem(x Expr) bool {
    	switch x := x.(type) {
    	case *ArrayType, *StructType, *FuncType, *InterfaceType, *SliceType, *MapType, *ChanType:
    		return true
    	case *Operation:
    		return isTypeElem(x.X) || (x.Y != nil && isTypeElem(x.Y)) || x.Op == Tilde
    	case *ParenExpr:
    		return isTypeElem(x.X)
    	}
    	return false
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 62.9K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types/fmt.go

    		default:
    			b.WriteByte(' ')
    			formatParams(b, t.Results(), mode, visited)
    		}
    
    	case TSTRUCT:
    		if m := t.StructType().Map; m != nil {
    			mt := m.MapType()
    			// Format the bucket struct for map[x]y as map.bucket[x]y.
    			// This avoids a recursive print that generates very long names.
    			switch t {
    			case mt.Bucket:
    				b.WriteString("map.bucket[")
    			default:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 15:41:17 UTC 2023
    - 15.7K bytes
    - Viewed (0)
  5. src/cmd/cgo/ast.go

    		}
    		f.walk(n.Params, ctxParam, visit)
    		if n.Results != nil {
    			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)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 07 16:54:27 UTC 2023
    - 14.3K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go

    			a.apply(n, "TypeParams", nil, tparams)
    		}
    		a.apply(n, "Params", nil, n.Params)
    		a.apply(n, "Results", nil, n.Results)
    
    	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
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 12.2K bytes
    - Viewed (0)
  7. src/go/ast/filter.go

    		b2 := filterParamList(t.Results, f, export)
    		return b1 || b2
    	case *InterfaceType:
    		if filterFieldList(t.Methods, f, export) {
    			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
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  8. src/reflect/value.go

    // As in Go, the key's value must be assignable to the map's key type.
    func (v Value) MapIndex(key Value) Value {
    	v.mustBe(Map)
    	tt := (*mapType)(unsafe.Pointer(v.typ()))
    
    	// Do not require key to be exported, so that DeepEqual
    	// and other programs can use all the keys returned by
    	// MapKeys as arguments to MapIndex. If either the map
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 119.9K bytes
    - Viewed (0)
  9. src/runtime/alg.go

    		return h
    	default:
    		// Should never happen, as typehash should only be called
    		// with comparable types.
    		panic(errorString("hash of unhashable type " + toRType(t).string()))
    	}
    }
    
    func mapKeyError(t *maptype, p unsafe.Pointer) error {
    	if !t.HashMightPanic() {
    		return nil
    	}
    	return mapKeyError2(t.Key, p)
    }
    
    func mapKeyError2(t *_type, p unsafe.Pointer) error {
    	if t.TFlag&abi.TFlagRegularMemory != 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 13.6K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/typexpr.go

    		check.funcType(typ, nil, nil, e)
    		return typ
    
    	case *syntax.InterfaceType:
    		typ := check.newInterface()
    		setDefType(def, typ)
    		check.interfaceType(typ, e, def)
    		return typ
    
    	case *syntax.MapType:
    		typ := new(Map)
    		setDefType(def, typ)
    
    		typ.key = check.varType(e.Key)
    		typ.elem = check.varType(e.Value)
    
    		// spec: "The comparison operators == and != must be fully defined
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.6K bytes
    - Viewed (0)
Back to top