Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 57 for Elts (0.04 sec)

  1. src/go/printer/testdata/parser.go

    	if p.trace {
    		defer un(trace(p, "LiteralValue"))
    	}
    
    	lbrace := p.expect(token.LBRACE)
    	var elts []ast.Expr
    	p.exprLev++
    	if p.tok != token.RBRACE {
    		elts = p.parseElementList()
    	}
    	p.exprLev--
    	rbrace := p.expect(token.RBRACE)
    	return &ast.CompositeLit{typ, lbrace, elts, rbrace}
    }
    
    // checkExpr checks that x is an expression (and not a type).
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 20:19:51 UTC 2023
    - 50.5K bytes
    - Viewed (0)
  2. src/cmd/cgo/ast.go

    		f.walk(&n.Elt, ctxType, visit)
    	case *ast.BasicLit:
    	case *ast.FuncLit:
    		f.walk(n.Type, ctxType, visit)
    		f.walk(n.Body, ctxStmt, visit)
    	case *ast.CompositeLit:
    		f.walk(&n.Type, ctxType, visit)
    		f.walk(n.Elts, ctxExpr, visit)
    	case *ast.ParenExpr:
    		f.walk(&n.X, context, visit)
    	case *ast.SelectorExpr:
    		f.walk(&n.X, ctxSelector, visit)
    	case *ast.IndexExpr:
    		f.walk(&n.X, ctxExpr, 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)
  3. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go

    		a.apply(n, "Elt", nil, n.Elt)
    
    	case *ast.FuncLit:
    		a.apply(n, "Type", nil, n.Type)
    		a.apply(n, "Body", nil, n.Body)
    
    	case *ast.CompositeLit:
    		a.apply(n, "Type", nil, n.Type)
    		a.applyList(n, "Elts")
    
    	case *ast.ParenExpr:
    		a.apply(n, "X", nil, n.X)
    
    	case *ast.SelectorExpr:
    		a.apply(n, "X", nil, n.X)
    		a.apply(n, "Sel", nil, n.Sel)
    
    	case *ast.IndexExpr:
    		a.apply(n, "X", nil, n.X)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 12.2K bytes
    - Viewed (0)
  4. src/go/parser/parser.go

    		defer un(trace(p, "LiteralValue"))
    	}
    
    	lbrace := p.expect(token.LBRACE)
    	var elts []ast.Expr
    	p.exprLev++
    	if p.tok != token.RBRACE {
    		elts = p.parseElementList()
    	}
    	p.exprLev--
    	rbrace := p.expectClosing(token.RBRACE, "composite literal")
    	return &ast.CompositeLit{Type: typ, Lbrace: lbrace, Elts: elts, Rbrace: rbrace}
    }
    
    func (p *parser) parsePrimaryExpr(x ast.Expr) ast.Expr {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 20:07:50 UTC 2023
    - 72.2K bytes
    - Viewed (0)
  5. src/go/ast/ast.go

    	CompositeLit struct {
    		Type       Expr      // literal type; or nil
    		Lbrace     token.Pos // position of "{"
    		Elts       []Expr    // list of composite elements; or nil
    		Rbrace     token.Pos // position of "}"
    		Incomplete bool      // true if (source) expressions are missing in the Elts list
    	}
    
    	// A ParenExpr node represents a parenthesized expression.
    	ParenExpr struct {
    		Lparen token.Pos // position of "("
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  6. src/go/parser/resolver.go

    	case *ast.FuncType:
    		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
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 02 12:56:53 UTC 2023
    - 15.8K bytes
    - Viewed (0)
  7. src/go/printer/printer_test.go

    		panic(err)
    	}
    
    	// Replace the result with call(), which is on the next line.
    	fd := file.Decls[0].(*ast.FuncDecl)
    	ret := fd.Body.List[0].(*ast.ReturnStmt)
    	ret.Results[0] = ret.Results[0].(*ast.CompositeLit).Elts[0]
    
    	var buf bytes.Buffer
    	if err := Fprint(&buf, fset, ret); err != nil {
    		t.Fatal(err)
    	}
    	want := "return call()"
    	if got := buf.String(); got != want {
    		t.Fatalf("got %q, want %q", got, want)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 03 14:56:25 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  8. src/go/printer/nodes.go

    		p.exprList(x.Lbrace, x.Elts, 1, commaTerm, x.Rbrace, x.Incomplete)
    		// do not insert extra line break following a /*-style comment
    		// before the closing '}' as it might break the code if there
    		// is no trailing ','
    		mode := noExtraLinebreak
    		// do not insert extra blank following a /*-style comment
    		// before the closing '}' unless the literal is empty
    		if len(x.Elts) > 0 {
    			mode |= noExtraBlank
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 17 18:53:17 UTC 2023
    - 52.6K bytes
    - Viewed (0)
  9. src/cmd/doc/pkg.go

    		}
    		return dotDotDot
    
    	case *ast.FuncLit:
    		return pkg.oneLineNodeDepth(n.Type, depth) + " { ... }"
    
    	case *ast.CompositeLit:
    		typ := pkg.oneLineNodeDepth(n.Type, depth)
    		if len(n.Elts) == 0 {
    			return fmt.Sprintf("%s{}", typ)
    		}
    		return fmt.Sprintf("%s{ %s }", typ, dotDotDot)
    
    	case *ast.ArrayType:
    		length := pkg.oneLineNodeDepth(n.Len, depth)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 08 20:15:52 UTC 2024
    - 32K bytes
    - Viewed (0)
  10. pilot/pkg/networking/core/envoyfilter/cluster_patch_test.go

    				Value: buildPatchStruct(`
    					{"transport_socket":{
    						"name":"transport_sockets.alts",
    						"typed_config":{
    							"@type":"type.googleapis.com/udpa.type.v1.TypedStruct",
                  "type_url": "type.googleapis.com/envoy.extensions.transport_sockets.alts.v3.Alts",
    							"value":{"handshaker_service":"1.2.3.4"}}}}`),
    			},
    		},
    	}
    
    	sidecarOutboundIn := []*cluster.Cluster{
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Mar 28 17:09:02 UTC 2024
    - 20.7K bytes
    - Viewed (0)
Back to top