Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 69 for parseRule (0.15 sec)

  1. src/internal/diff/diff_test.go

    	files, _ := filepath.Glob("testdata/*.txt")
    	if len(files) == 0 {
    		t.Fatalf("no testdata")
    	}
    
    	for _, file := range files {
    		t.Run(filepath.Base(file), func(t *testing.T) {
    			a, err := txtar.ParseFile(file)
    			if err != nil {
    				t.Fatal(err)
    			}
    			if len(a.Files) != 3 || a.Files[2].Name != "diff" {
    				t.Fatalf("%s: want three files, third named \"diff\"", file)
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 18 16:56:29 UTC 2022
    - 1.1K bytes
    - Viewed (0)
  2. src/go/doc/example_test.go

    			fset := token.NewFileSet()
    			astFile, err := parser.ParseFile(fset, filename, nil, parser.ParseComments)
    			if err != nil {
    				t.Fatal(err)
    			}
    			goldenFilename := strings.TrimSuffix(filename, ".go") + ".golden"
    			archive, err := txtar.ParseFile(goldenFilename)
    			if err != nil {
    				t.Fatal(err)
    			}
    			golden := map[string]string{}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 10 16:17:51 UTC 2022
    - 9.6K bytes
    - Viewed (0)
  3. src/vendor/golang.org/x/net/route/sys_openbsd.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 {
    	switch typ {
    	case syscall.NET_RT_STATS, syscall.NET_RT_TABLE:
    		return false
    	default:
    		return true
    	}
    }
    
    // RouteMetrics represents route metrics.
    type RouteMetrics struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 05 19:54:32 UTC 2022
    - 2.1K bytes
    - Viewed (0)
  4. src/internal/txtar/archive.go

    	var buf bytes.Buffer
    	buf.Write(fixNL(a.Comment))
    	for _, f := range a.Files {
    		fmt.Fprintf(&buf, "-- %s --\n", f.Name)
    		buf.Write(fixNL(f.Data))
    	}
    	return buf.Bytes()
    }
    
    // ParseFile parses the named file as an archive.
    func ParseFile(file string) (*Archive, error) {
    	data, err := os.ReadFile(file)
    	if err != nil {
    		return nil, err
    	}
    	return Parse(data), nil
    }
    
    // Parse parses the serialized form of an Archive.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 20 02:13:02 UTC 2022
    - 4.2K bytes
    - Viewed (0)
  5. src/go/doc/example_internal_test.go

    import (
    	"a"
    
    	_ "b"
    
    	_ "c"
    	"d"
    )`,
    			want: []string{"a", "b", "c"},
    		},
    	} {
    		t.Run(test.name, func(t *testing.T) {
    			fset := token.NewFileSet()
    			file, err := parser.ParseFile(fset, "test.go", strings.NewReader(test.in), parser.ParseComments)
    			if err != nil {
    				t.Fatal(err)
    			}
    			imps := findImportGroupStarts1(file.Imports)
    			got := make([]string, len(imps))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 10 14:22:16 UTC 2022
    - 1.6K bytes
    - Viewed (0)
  6. src/vendor/golang.org/x/net/route/message.go

    const (
    	SysMetrics SysType = iota
    	SysStats
    )
    
    // ParseRIB parses b as a routing information base and returns a list
    // of routing messages.
    func ParseRIB(typ RIBType, b []byte) ([]Message, error) {
    	if !typ.parseable() {
    		return nil, errUnsupportedMessage
    	}
    	var msgs []Message
    	nmsgs, nskips := 0, 0
    	for len(b) > 4 {
    		nmsgs++
    		l := int(nativeEndian.Uint16(b[:2]))
    		if l == 0 {
    			return nil, errInvalidMessage
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  7. src/vendor/golang.org/x/net/route/sys_darwin.go

    // Copyright 2016 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package route
    
    import "syscall"
    
    func (typ RIBType) parseable() bool {
    	switch typ {
    	case syscall.NET_RT_STAT, syscall.NET_RT_TRASH:
    		return false
    	default:
    		return true
    	}
    }
    
    // RouteMetrics represents route metrics.
    type RouteMetrics struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 05 19:54:32 UTC 2022
    - 2.8K bytes
    - Viewed (0)
  8. pilot/pkg/features/ambient.go

    )
    
    // registerAmbient registers a variable that is allowed only if EnableAmbient is set
    func registerAmbient[T env.Parseable](name string, defaultWithAmbient, defaultWithoutAmbient T, description string) T {
    	if EnableAmbient {
    		return env.Register(name, defaultWithAmbient, description).Get()
    	}
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sun May 05 00:02:56 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  9. src/go/ast/filter_test.go

    func (t1) f1() {}
    func (t1) f2() {}
    
    func (t2) f1() {}
    
    func (x *t2) f2() {}
    `
    
    func TestFilterDuplicates(t *testing.T) {
    	// parse input
    	fset := token.NewFileSet()
    	file, err := parser.ParseFile(fset, "", input, 0)
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	// create package
    	files := map[string]*ast.File{"": file}
    	pkg, err := ast.NewPackage(fset, files, nil, nil)
    	if err != nil {
    		t.Fatal(err)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 09 15:35:30 UTC 2022
    - 1.6K bytes
    - Viewed (0)
  10. src/go/token/example_test.go

    const bad = token.NoPos
    
    //line fake.go:42:11
    func ok(pos p) bool {
    	return pos != bad
    }
    
    /*line :7:9*/func main() {
    	fmt.Println(ok(bad) == bad.IsValid())
    }
    `
    
    	f, err := parser.ParseFile(fset, "main.go", src, 0)
    	if err != nil {
    		fmt.Println(err)
    		return
    	}
    
    	// Print the location and kind of each declaration in f.
    	for _, decl := range f.Decls {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 09 22:09:31 UTC 2023
    - 1.7K bytes
    - Viewed (0)
Back to top