Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 34 for KeyValueExpr (0.17 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/ast/inspector/typeof.go

    		return 1 << nIncDecStmt
    	case *ast.IndexExpr:
    		return 1 << nIndexExpr
    	case *ast.IndexListExpr:
    		return 1 << nIndexListExpr
    	case *ast.InterfaceType:
    		return 1 << nInterfaceType
    	case *ast.KeyValueExpr:
    		return 1 << nKeyValueExpr
    	case *ast.LabeledStmt:
    		return 1 << nLabeledStmt
    	case *ast.MapType:
    		return 1 << nMapType
    	case *ast.Package:
    		return 1 << nPackage
    	case *ast.ParenExpr:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/expr.go

    			// (e.g., a duplicate field error doesn't need the struct type).
    			fields := utyp.fields
    			if _, ok := e.ElemList[0].(*syntax.KeyValueExpr); ok {
    				// all elements must have keys
    				visited := make([]bool, len(fields))
    				for _, e := range e.ElemList {
    					kv, _ := e.(*syntax.KeyValueExpr)
    					if kv == nil {
    						check.error(e, MixedStructLit, "mixture of field:value and value elements in struct literal")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 51.7K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go

    		children = append(children,
    			tok(n.Lbrack, len("[")),
    			tok(n.Rbrack, len("]")))
    
    	case *ast.InterfaceType:
    		children = append(children,
    			tok(n.Interface, len("interface")))
    
    	case *ast.KeyValueExpr:
    		children = append(children,
    			tok(n.Colon, len(":")))
    
    	case *ast.LabeledStmt:
    		children = append(children,
    			tok(n.Colon, len(":")))
    
    	case *ast.MapType:
    		children = append(children,
    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/fix/typecheck.go

    						if kv, ok := e.(*ast.KeyValueExpr); ok {
    							if typeof[kv.Key] == "" {
    								typeof[kv.Key] = kt
    							}
    							if typeof[kv.Value] == "" {
    								typeof[kv.Value] = vt
    							}
    						}
    					}
    				}
    			}
    			if typ := cfg.Type[t]; typ != nil && len(typ.Field) > 0 { // struct
    				for _, e := range n.Elts {
    					if kv, ok := e.(*ast.KeyValueExpr); ok {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 16 22:02:42 UTC 2022
    - 20.1K bytes
    - Viewed (0)
  5. src/go/ast/walk.go

    		Walk(v, n.Fun)
    		walkList(v, n.Args)
    
    	case *StarExpr:
    		Walk(v, n.X)
    
    	case *UnaryExpr:
    		Walk(v, n.X)
    
    	case *BinaryExpr:
    		Walk(v, n.X)
    		Walk(v, n.Y)
    
    	case *KeyValueExpr:
    		Walk(v, n.Key)
    		Walk(v, n.Value)
    
    	// Types
    	case *ArrayType:
    		if n.Len != nil {
    			Walk(v, n.Len)
    		}
    		Walk(v, n.Elt)
    
    	case *StructType:
    		Walk(v, n.Fields)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:34:10 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/syntax/walk.go

    	case *Name: // nothing to do
    	case *BasicLit: // nothing to do
    
    	case *CompositeLit:
    		if n.Type != nil {
    			w.node(n.Type)
    		}
    		w.exprList(n.ElemList)
    
    	case *KeyValueExpr:
    		w.node(n.Key)
    		w.node(n.Value)
    
    	case *FuncLit:
    		w.node(n.Type)
    		w.node(n.Body)
    
    	case *ParenExpr:
    		w.node(n.X)
    
    	case *SelectorExpr:
    		w.node(n.X)
    		w.node(n.Sel)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:55:04 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  7. src/go/doc/exports.go

    func filterExprList(list []ast.Expr, filter Filter, export bool) []ast.Expr {
    	j := 0
    	for _, exp := range list {
    		switch x := exp.(type) {
    		case *ast.CompositeLit:
    			filterCompositeLit(x, filter, export)
    		case *ast.KeyValueExpr:
    			if x, ok := x.Key.(*ast.Ident); ok && !filter(x.Name) {
    				continue
    			}
    			if x, ok := x.Value.(*ast.CompositeLit); ok {
    				filterCompositeLit(x, filter, export)
    			}
    		}
    		list[j] = exp
    		j++
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 01 18:18:07 UTC 2022
    - 8.5K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/syntax/nodes.go

    	CompositeLit struct {
    		Type     Expr // nil means no literal type
    		ElemList []Expr
    		NKeys    int // number of elements with keys
    		Rbrace   Pos
    		expr
    	}
    
    	// Key: Value
    	KeyValueExpr struct {
    		Key, Value Expr
    		expr
    	}
    
    	// func Type { Body }
    	FuncLit struct {
    		Type *FuncType
    		Body *BlockStmt
    		expr
    	}
    
    	// (X)
    	ParenExpr struct {
    		X Expr
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 14:52:38 UTC 2023
    - 9K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/copylock/copylock.go

    	}
    }
    
    // checkCopyLocksCompositeLit detects lock copy inside a composite literal
    func checkCopyLocksCompositeLit(pass *analysis.Pass, cl *ast.CompositeLit) {
    	for _, x := range cl.Elts {
    		if node, ok := x.(*ast.KeyValueExpr); ok {
    			x = node.Value
    		}
    		if path := lockPathRhs(pass, x); path != nil {
    			pass.ReportRangef(x, "literal copies lock value from %v: %v", analysisutil.Format(pass.Fset, x), path)
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  10. src/go/types/index.go

    	visited := make(map[int64]bool, len(elts))
    	var index, max int64
    	for _, e := range elts {
    		// determine and check index
    		validIndex := false
    		eval := e
    		if kv, _ := e.(*ast.KeyValueExpr); kv != nil {
    			if typ, i := check.index(kv.Key, length); isValid(typ) {
    				if i >= 0 {
    					index = i
    					validIndex = true
    				} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 16:17:05 UTC 2024
    - 11.2K bytes
    - Viewed (0)
Back to top