Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for KeyValueExpr (0.19 sec)

  1. src/cmd/fix/netipv6zone.go

    				if _, ok := e.(*ast.KeyValueExpr); ok {
    					break
    				}
    				switch i {
    				case 0:
    					cl.Elts[i] = &ast.KeyValueExpr{
    						Key:   ast.NewIdent("IP"),
    						Value: e,
    					}
    				case 1:
    					if elit, ok := e.(*ast.BasicLit); ok && elit.Value == "0" {
    						cl.Elts = append(cl.Elts[:i], cl.Elts[i+1:]...)
    					} else {
    						cl.Elts[i] = &ast.KeyValueExpr{
    							Key:   ast.NewIdent("Port"),
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 1.3K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/syntax/issues_test.go

    		want := colbase + uint(i)
    
    		f, err := Parse(nil, strings.NewReader(src), nil, nil, 0)
    		if err != nil {
    			t.Errorf("%s: %v", src, err)
    			continue
    		}
    
    		// locate KeyValueExpr
    		Inspect(f, func(n Node) bool {
    			_, ok := n.(*KeyValueExpr)
    			if ok {
    				if got := StartPos(n).Col(); got != want {
    					t.Errorf("%s: got col = %d, want %d", src, got, want)
    				}
    			}
    			return !ok
    		})
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 17:49:19 UTC 2024
    - 1.2K bytes
    - Viewed (0)
  3. src/cmd/fix/printerconfig.go

    		}
    
    		if ss := se.Sel.String(); ss == "Config" {
    			for i, e := range cl.Elts {
    				if _, ok := e.(*ast.KeyValueExpr); ok {
    					break
    				}
    				switch i {
    				case 0:
    					cl.Elts[i] = &ast.KeyValueExpr{
    						Key:   ast.NewIdent("Mode"),
    						Value: e,
    					}
    				case 1:
    					cl.Elts[i] = &ast.KeyValueExpr{
    						Key:   ast.NewIdent("Tabwidth"),
    						Value: e,
    					}
    				}
    				fixed = true
    			}
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 1.1K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/syntax/positions.go

    		// expressions
    		// case *BadExpr:
    		// case *Name:
    		// case *BasicLit:
    		case *CompositeLit:
    			if n.Type != nil {
    				m = n.Type
    				continue
    			}
    			return n.Pos()
    		case *KeyValueExpr:
    			m = n.Key
    		// case *FuncLit:
    		// case *ParenExpr:
    		case *SelectorExpr:
    			m = n.X
    		case *IndexExpr:
    			m = n.X
    		// case *SliceExpr:
    		case *AssertExpr:
    			m = n.X
    		case *TypeSwitchGuard:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 17:49:19 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/syntax/nodes_test.go

    	{"BasicLit", `@'a'`},
    	{"BasicLit", `@"abc"`},
    	{"BasicLit", "@`abc`"},
    
    	{"CompositeLit", `@{}`},
    	{"CompositeLit", `T@{}`},
    	{"CompositeLit", `struct{x, y int}@{}`},
    
    	{"KeyValueExpr", `"foo"@: true`},
    	{"KeyValueExpr", `"a"@: b`},
    
    	{"FuncLit", `@func (){}`},
    	{"ParenExpr", `@(x)`},
    	{"SelectorExpr", `a@.b`},
    	{"IndexExpr", `a@[i]`},
    
    	{"SliceExpr", `a@[:]`},
    	{"SliceExpr", `a@[i:]`},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 02 18:45:06 UTC 2023
    - 8.7K bytes
    - Viewed (0)
  6. src/go/types/exprstring.go

    	// operator precedences. (This assumes that the AST was
    	// generated by a Go parser.)
    
    	switch x := x.(type) {
    	default:
    		fmt.Fprintf(buf, "(ast: %T)", x) // nil, ast.BadExpr, ast.KeyValueExpr
    
    	case *ast.Ident:
    		buf.WriteString(x.Name)
    
    	case *ast.Ellipsis:
    		buf.WriteString("...")
    		if x.Elt != nil {
    			WriteExpr(buf, x.Elt)
    		}
    
    	case *ast.BasicLit:
    		buf.WriteString(x.Value)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 08 19:31:44 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/composite/composite.go

    			allKeyValue := true
    			var suggestedFixAvailable = len(cl.Elts) == strct.NumFields()
    			var missingKeys []analysis.TextEdit
    			for i, e := range cl.Elts {
    				if _, ok := e.(*ast.KeyValueExpr); !ok {
    					allKeyValue = false
    					if i >= strct.NumFields() {
    						break
    					}
    					field := strct.Field(i)
    					if !field.Exported() {
    						// Adding unexported field names for structs not defined
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  8. src/cmd/gofmt/simplify.go

    				ktyp = reflect.ValueOf(keyType)
    			}
    			typ := reflect.ValueOf(eltType)
    			for i, x := range outer.Elts {
    				px := &outer.Elts[i]
    				// look at value of indexed/named elements
    				if t, ok := x.(*ast.KeyValueExpr); ok {
    					if keyType != nil {
    						s.simplifyLiteral(ktyp, keyType, t.Key, &t.Key)
    					}
    					x = t.Value
    					px = &t.Value
    				}
    				s.simplifyLiteral(typ, eltType, x, px)
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 19 20:06:14 UTC 2022
    - 4.8K bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top