Search Options

Results per page
Sort
Preferred Languages
Advance

Results 121 - 130 of 1,083 for rewrites (1.37 sec)

  1. src/cmd/gofmt/testdata/rewrite7.golden

    // attribute for the last argument into account.
    
    package p
    
    func fun(x []int) {}
    
    func g(x []int) {
    	fun(x) // -r='fun(x...)->Fun(x)' should not rewrite this
    	Fun(x) // -r='fun(x...)->Fun(x)' should rewrite this to Fun(x)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 22 00:25:13 UTC 2014
    - 466 bytes
    - Viewed (0)
  2. src/cmd/gofmt/testdata/rewrite5.input

    // expressions without those nodes must also eliminate the associated
    // comments.
    
    package p
    
    func f(x int) int {
    	_ = x + x // this comment remains in the rewrite
    	_ = x /* this comment must not be in the rewrite */ + x
    	return x /* this comment must not be in the rewrite */ + x
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 22 00:25:13 UTC 2014
    - 538 bytes
    - Viewed (0)
  3. src/cmd/gofmt/testdata/rewrite3.golden

    // license that can be found in the LICENSE file.
    
    package main
    
    // Field tags are *ast.BasicLit nodes that are nil when the tag is
    // absent. These nil nodes must not be mistaken for expressions,
    // the rewriter should not try to dereference them. Was issue 2410.
    type Foo struct {
    	Field int
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 22 00:25:13 UTC 2014
    - 422 bytes
    - Viewed (0)
  4. src/cmd/gofmt/rewrite.go

    )
    
    func initRewrite() {
    	if *rewriteRule == "" {
    		rewrite = nil // disable any previous rewrite
    		return
    	}
    	f := strings.Split(*rewriteRule, "->")
    	if len(f) != 2 {
    		fmt.Fprintf(os.Stderr, "rewrite rule must be of the form 'pattern -> replacement'\n")
    		os.Exit(2)
    	}
    	pattern := parseExpr(f[0], "pattern")
    	replace := parseExpr(f[1], "replacement")
    	rewrite = func(fset *token.FileSet, p *ast.File) *ast.File {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 27 22:07:13 UTC 2023
    - 8.1K bytes
    - Viewed (0)
  5. src/cmd/gofmt/testdata/rewrite6.golden

    // attribute for the last argument into account.
    
    package p
    
    func fun(x []int) {}
    
    func g(x []int) {
    	Fun(x)    // -r='fun(x)->Fun(x)' should rewrite this to Fun(x)
    	fun(x...) // -r='fun(x)->Fun(x)' should not rewrite this
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 22 00:25:13 UTC 2014
    - 463 bytes
    - Viewed (0)
  6. src/cmd/gofmt/testdata/rewrite6.input

    // attribute for the last argument into account.
    
    package p
    
    func fun(x []int) {}
    
    func g(x []int) {
    	fun(x)    // -r='fun(x)->Fun(x)' should rewrite this to Fun(x)
    	fun(x...) // -r='fun(x)->Fun(x)' should not rewrite this
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 22 00:25:13 UTC 2014
    - 463 bytes
    - Viewed (0)
  7. src/cmd/gofmt/testdata/rewrite3.input

    // license that can be found in the LICENSE file.
    
    package main
    
    // Field tags are *ast.BasicLit nodes that are nil when the tag is
    // absent. These nil nodes must not be mistaken for expressions,
    // the rewriter should not try to dereference them. Was issue 2410.
    type Foo struct {
    	Field int
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 22 00:25:13 UTC 2014
    - 422 bytes
    - Viewed (0)
  8. src/cmd/gofmt/testdata/rewrite2.golden

    // license that can be found in the LICENSE file.
    
    package p
    
    // Slices have nil Len values in the corresponding ast.ArrayType
    // node and reflect.NewValue(slice.Len) is an invalid reflect.Value.
    // The rewriter must not crash in that case. Was issue 1696.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 22 00:25:13 UTC 2014
    - 407 bytes
    - Viewed (0)
  9. src/cmd/gofmt/testdata/rewrite2.input

    // license that can be found in the LICENSE file.
    
    package p
    
    // Slices have nil Len values in the corresponding ast.ArrayType
    // node and reflect.NewValue(slice.Len) is an invalid reflect.Value.
    // The rewriter must not crash in that case. Was issue 1696.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 22 00:25:13 UTC 2014
    - 406 bytes
    - Viewed (0)
  10. src/cmd/gofmt/testdata/rewrite5.golden

    // expressions without those nodes must also eliminate the associated
    // comments.
    
    package p
    
    func f(x int) int {
    	_ = 2 * x // this comment remains in the rewrite
    	_ = 2 * x
    	return 2 * x
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 22 00:25:13 UTC 2014
    - 446 bytes
    - Viewed (0)
Back to top