Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 43 for parseRule (0.27 sec)

  1. pkg/proxy/ipvs/proxier_test.go

    		_ = ipt.SaveInto(utiliptables.TableNAT, buf)
    		natRules := strings.Split(buf.String(), "\n")
    		var hasMasqueradeJump, hasMasqRandomFully bool
    		for _, line := range natRules {
    			rule, _ := iptablestest.ParseRule(line, false)
    			if rule != nil && rule.Chain == kubePostroutingChain && rule.Jump != nil && rule.Jump.Value == "MASQUERADE" {
    				hasMasqueradeJump = true
    				if rule.RandomFully != nil {
    					hasMasqRandomFully = true
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Apr 27 01:31:57 UTC 2024
    - 186.8K bytes
    - Viewed (0)
  2. src/go/printer/printer_test.go

    // src is syntactically correct, and returns the resulting src or an error
    // if any.
    func format(src []byte, mode checkMode) ([]byte, error) {
    	// parse src
    	f, err := parser.ParseFile(fset, "", src, parser.ParseComments)
    	if err != nil {
    		return nil, fmt.Errorf("parse: %s\n%s", err, src)
    	}
    
    	// filter exports if necessary
    	if mode&export != 0 {
    		ast.FileExports(f) // ignore result
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 03 14:56:25 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top