Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for KeyValueExpr (0.35 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
Back to top