- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 35 for KeyValueExpr (0.29 sec)
-
src/cmd/compile/internal/types2/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.(*syntax.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: Fri Sep 15 16:16:58 UTC 2023 - 11.5K bytes - Viewed (0) -
src/cmd/cgo/ast.go
case *ast.StarExpr: f.walk(&n.X, context, visit) case *ast.UnaryExpr: f.walk(&n.X, ctxExpr, visit) case *ast.BinaryExpr: f.walk(&n.X, ctxExpr, visit) f.walk(&n.Y, ctxExpr, visit) case *ast.KeyValueExpr: f.walk(&n.Key, ctxExpr, visit) f.walk(&n.Value, ctxExpr, visit) case *ast.ArrayType: f.walk(&n.Len, ctxExpr, visit) f.walk(&n.Elt, ctxType, visit) case *ast.StructType:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jun 07 16:54:27 UTC 2023 - 14.3K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go
case *ast.StarExpr: a.apply(n, "X", nil, n.X) case *ast.UnaryExpr: a.apply(n, "X", nil, n.X) case *ast.BinaryExpr: a.apply(n, "X", nil, n.X) a.apply(n, "Y", nil, n.Y) case *ast.KeyValueExpr: a.apply(n, "Key", nil, n.Key) a.apply(n, "Value", nil, n.Value) // Types case *ast.ArrayType: a.apply(n, "Len", nil, n.Len) a.apply(n, "Elt", nil, n.Elt) case *ast.StructType:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 18 21:28:13 UTC 2023 - 12.2K bytes - Viewed (0) -
src/go/ast/filter.go
func filterExprList(list []Expr, filter Filter, export bool) []Expr { j := 0 for _, exp := range list { switch x := exp.(type) { case *CompositeLit: filterCompositeLit(x, filter, export) case *KeyValueExpr: if x, ok := x.Key.(*Ident); ok && !filter(x.Name) { continue } if x, ok := x.Value.(*CompositeLit); ok { filterCompositeLit(x, filter, export) } } list[j] = exp j++
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 13.3K bytes - Viewed (0) -
src/cmd/fix/fix.go
walkBeforeAfter(&n.X, before, after) case *ast.UnaryExpr: walkBeforeAfter(&n.X, before, after) case *ast.BinaryExpr: walkBeforeAfter(&n.X, before, after) walkBeforeAfter(&n.Y, before, after) case *ast.KeyValueExpr: walkBeforeAfter(&n.Key, before, after) walkBeforeAfter(&n.Value, before, after) case *ast.ArrayType: walkBeforeAfter(&n.Len, before, after) walkBeforeAfter(&n.Elt, before, after)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 13 18:45:54 UTC 2021 - 14.6K bytes - Viewed (0) -
src/go/parser/resolver.go
r.openScope(n.Pos()) defer r.closeScope() r.walkFuncType(n) case *ast.CompositeLit: if n.Type != nil { ast.Walk(r, n.Type) } for _, e := range n.Elts { if kv, _ := e.(*ast.KeyValueExpr); kv != nil { // See go.dev/issue/45160: try to resolve composite lit keys, but don't // collect them as unresolved if resolution failed. This replicates // existing behavior when resolving during parsing.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Nov 02 12:56:53 UTC 2023 - 15.8K bytes - Viewed (0) -
src/go/doc/example.go
// (For an expression like fmt.Println, only add "fmt" to the // set of unresolved names, not "Println".) ast.Inspect(e.X, inspectFunc) return false case *ast.KeyValueExpr: // For key value expressions, only inspect the value // as the key should be resolved by the type of the // composite literal. ast.Inspect(e.Value, inspectFunc) return false } return true
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 21.4K bytes - Viewed (0) -
src/cmd/compile/internal/syntax/printer.go
p.print(n.X) } else { // binary expr // TODO(gri) eventually take precedence into account // to control possibly missing parentheses p.print(n.X, blank, n.Op, blank, n.Y) } case *KeyValueExpr: p.print(n.Key, _Colon, blank, n.Value) case *ListExpr: p.printExprList(n.ElemList) case *ArrayType: var len interface{} = _DotDotDot if n.Len != nil { len = n.Len }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Aug 24 07:17:27 UTC 2023 - 21.5K bytes - Viewed (0) -
src/go/parser/parser_test.go
{name: "maplit", format: "package main; var x = «map[int]any{1:«nil»}»", parseMultiplier: 2}, // Parser nodes: CompositeLit, KeyValueExpr {name: "dot", format: "package main; var x = «x.»x"}, {name: "index", format: "package main; var x = x«[1]»"}, {name: "slice", format: "package main; var x = x«[1:2]»"},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jan 31 20:26:14 UTC 2024 - 24.6K bytes - Viewed (0) -
src/go/printer/nodes.go
// generated code - simply ignore the size in this case by setting // it to 0). prevSize := size const infinity = 1e6 // larger than any source line size = p.nodeSize(x, infinity) pair, isPair := x.(*ast.KeyValueExpr) if size <= infinity && prev.IsValid() && next.IsValid() { // x fits on a single line if isPair { size = p.nodeSize(pair.Key, infinity) // size <= infinity } } else {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Oct 17 18:53:17 UTC 2023 - 52.6K bytes - Viewed (0)