Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 69 for parseRule (0.15 sec)

  1. src/internal/trace/reader_test.go

    		testName, err := filepath.Rel("./testdata", testPath)
    		if err != nil {
    			t.Fatalf("failed to relativize testdata path: %v", err)
    		}
    		t.Run(testName, func(t *testing.T) {
    			tr, exp, err := testtrace.ParseFile(testPath)
    			if err != nil {
    				t.Fatalf("failed to parse test file at %s: %v", testPath, err)
    			}
    			testReader(t, tr, exp)
    		})
    	}
    }
    
    func FuzzReader(f *testing.F) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 3.7K bytes
    - Viewed (0)
  2. src/cmd/fix/main_test.go

    }
    
    func fnop(*ast.File) bool { return false }
    
    func parseFixPrint(t *testing.T, fn func(*ast.File) bool, desc, in string, mustBeGofmt bool) (out string, fixed, ok bool) {
    	file, err := parser.ParseFile(fset, desc, in, parserMode)
    	if err != nil {
    		t.Errorf("parsing: %v", err)
    		return
    	}
    
    	outb, err := gofmtFile(file)
    	if err != nil {
    		t.Errorf("printing: %v", err)
    		return
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 05:31:47 UTC 2024
    - 3.8K bytes
    - Viewed (0)
  3. src/vendor/golang.org/x/net/route/sys_freebsd.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package route
    
    import (
    	"syscall"
    	"unsafe"
    )
    
    func (typ RIBType) parseable() bool { return true }
    
    // RouteMetrics represents route metrics.
    type RouteMetrics struct {
    	PathMTU int // path maximum transmission unit
    }
    
    // SysType implements the SysType method of Sys interface.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 05 19:54:32 UTC 2022
    - 4.7K bytes
    - Viewed (0)
  4. src/cmd/vendor/golang.org/x/tools/internal/analysisinternal/extractdoc.go

    // the same source and formatted appropriately.
    func ExtractDoc(content, name string) (string, error) {
    	if content == "" {
    		return "", fmt.Errorf("empty Go source file")
    	}
    	fset := token.NewFileSet()
    	f, err := parser.ParseFile(fset, "", content, parser.ParseComments|parser.PackageClauseOnly)
    	if err != nil {
    		return "", fmt.Errorf("not a Go source file")
    	}
    	if f.Doc == nil {
    		return "", fmt.Errorf("Go source file has no package doc comment")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  5. src/go/types/eval_test.go

    			type R interface {} // must not shadow R in first line of this function body
    		}
    		`,
    	}
    
    	fset := token.NewFileSet()
    	var files []*ast.File
    	for i, src := range sources {
    		file, err := parser.ParseFile(fset, "p", src, parser.ParseComments)
    		if err != nil {
    			t.Fatalf("could not parse file %d: %s", i, err)
    		}
    
    		// Materialized aliases give a different (better)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 19:56:15 UTC 2024
    - 8.3K bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/buildtag/buildtag_old.go

    		if err := checkOtherFile(pass, name); err != nil {
    			return nil, err
    		}
    	}
    	for _, name := range pass.IgnoredFiles {
    		if strings.HasSuffix(name, ".go") {
    			f, err := parser.ParseFile(pass.Fset, name, nil, parser.ParseComments)
    			if err != nil {
    				// Not valid Go source code - not our job to diagnose, so ignore.
    				return nil, nil
    			}
    			checkGoFile(pass, f)
    		} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  7. src/go/internal/srcimporter/srcimporter.go

    			defer wg.Done()
    			src, err := open(filepath)
    			if err != nil {
    				errors[i] = err // open provides operation and filename in error
    				return
    			}
    			files[i], errors[i] = parser.ParseFile(p.fset, filepath, src, parser.SkipObjectResolution)
    			src.Close() // ignore Close error - parsing may have succeeded which is all we need
    		}(i, p.joinPath(dir, filename))
    	}
    	wg.Wait()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 23 18:54:32 UTC 2022
    - 8.2K bytes
    - Viewed (0)
  8. cmd/kubeadm/app/util/error.go

    	// check if the verbosity level in klog is high enough and print a stack trace.
    	f := flag.CommandLine.Lookup("v")
    	if f != nil {
    		// assume that the "v" flag contains a parseable Int32 as per klog's "Level" type alias,
    		// thus no error from ParseInt is handled here.
    		if v, e := strconv.ParseInt(f.Value.String(), 10, 32); e == nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Oct 25 16:35:10 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  9. src/cmd/internal/goobj/mkbuiltin.go

    	}
    }
    
    func mkbuiltin(w io.Writer) {
    	pkg := "runtime"
    	fset := token.NewFileSet()
    	path := filepath.Join("..", "..", "compile", "internal", "typecheck", "_builtin", "runtime.go")
    	f, err := parser.ParseFile(fset, path, nil, 0)
    	if err != nil {
    		log.Fatal(err)
    	}
    
    	decls := make(map[string]bool)
    
    	fmt.Fprintf(w, "var builtins = [...]struct{ name string; abi int }{\n")
    	for _, decl := range f.Decls {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:27 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  10. src/runtime/metrics/description_test.go

    func TestDocs(t *testing.T) {
    	want := formatDesc(t)
    
    	src, err := os.ReadFile("doc.go")
    	if err != nil {
    		t.Fatal(err)
    	}
    	fset := token.NewFileSet()
    	f, err := parser.ParseFile(fset, "doc.go", src, parser.ParseComments)
    	if err != nil {
    		t.Fatal(err)
    	}
    	fdoc := f.Doc
    	if fdoc == nil {
    		t.Fatal("no doc comment in doc.go")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 20 22:54:22 UTC 2023
    - 3.9K bytes
    - Viewed (0)
Back to top