Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for parseRule (0.17 sec)

  1. src/internal/trace/testtrace/format.go

    package testtrace
    
    import (
    	"bytes"
    	"fmt"
    	"internal/trace/raw"
    	"internal/txtar"
    	"io"
    )
    
    // ParseFile parses a test file generated by the testgen package.
    func ParseFile(testPath string) (io.Reader, *Expectation, error) {
    	ar, err := txtar.ParseFile(testPath)
    	if err != nil {
    		return nil, nil, fmt.Errorf("failed to read test file for %s: %v", testPath, err)
    	}
    	if len(ar.Files) != 2 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/schema/flatbuffer_compatibility_test.cc

      // Parse the schemas
      flatbuffers::Parser base_parser, current_parser;
      std::vector<const char *> include_directories;
      ASSERT_TRUE(ParseFile(&base_parser, base_filename, base_contents));
      ASSERT_TRUE(ParseFile(&current_parser, current_filename, current_contents));
      // Check that the schemas conform and fail if they don't
      auto err = current_parser.ConformTo(base_parser);
      if (!err.empty()) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 28 14:28:27 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  3. src/go/ast/example_test.go

    	src := `
    package p
    const c = 1.0
    var X = f(3.14)*2 + c
    `
    
    	// Create the AST by parsing src.
    	fset := token.NewFileSet() // positions are relative to fset
    	f, err := parser.ParseFile(fset, "src.go", src, 0)
    	if err != nil {
    		panic(err)
    	}
    
    	// Inspect the AST and print all identifiers and literals.
    	ast.Inspect(f, func(n ast.Node) bool {
    		var s string
    		switch x := n.(type) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 21:44:50 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  4. src/cmd/fix/main.go

    		return err
    	}
    
    	file, err := parser.ParseFile(fset, filename, src, parserMode)
    	if err != nil {
    		return err
    	}
    
    	// Make sure file is in canonical format.
    	// This "fmt" pseudo-fix cannot be disabled.
    	newSrc, err := gofmtFile(file)
    	if err != nil {
    		return err
    	}
    	if !bytes.Equal(newSrc, src) {
    		newFile, err := parser.ParseFile(fset, filename, newSrc, parserMode)
    		if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 19:41:17 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  5. src/go/ast/walk_test.go

    	// bug, this test failed with a runtime panic.
    	src := "package p\ntype T struct {\n\tF int `json:\"f\"` // a field\n}\n"
    
    	fset := token.NewFileSet()
    	f, err := parser.ParseFile(fset, "", src, 0)
    	if err != nil {
    		panic(err)
    	}
    
    	for n := range ast.Preorder(f) {
    		if id, ok := n.(*ast.Ident); ok && id.Name == "F" {
    			break
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:34:10 UTC 2024
    - 916 bytes
    - Viewed (0)
  6. src/internal/dag/parse.go

    	less []string
    	op   string // Either "<" or "!<"
    	def  []string
    }
    
    type syntaxError string
    
    func (e syntaxError) Error() string {
    	return string(e)
    }
    
    // parseRules parses the rules of a DAG.
    func parseRules(rules string) (out []rule, err error) {
    	defer func() {
    		e := recover()
    		switch e := e.(type) {
    		case nil:
    			return
    		case syntaxError:
    			err = e
    		default:
    			panic(e)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 6.7K bytes
    - Viewed (0)
  7. 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)
  8. src/cmd/vendor/golang.org/x/tools/internal/aliases/aliases_go122.go

    	//     setting caused by os.Setenv("GODEBUG"), as happens in
    	//     many tests. Therefore any attempt to cache the result
    	//     is just incorrect.
    	fset := token.NewFileSet()
    	f, _ := parser.ParseFile(fset, "a.go", "package p; type A = int", 0)
    	pkg, _ := new(types.Config).Check("p", fset, []*ast.File{f}, nil)
    	_, enabled := pkg.Scope().Lookup("A").Type().(*types.Alias)
    	return enabled
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 2K bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top