Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 70 for parseRule (0.19 sec)

  1. pkg/util/iptables/testing/fake.go

    		return false, err
    	}
    
    	rule := "-A " + string(chain) + " " + strings.Join(args, " ")
    	for _, r := range c.Rules {
    		if r.Raw == rule {
    			return true, nil
    		}
    	}
    
    	parsed, err := ParseRule(rule, false)
    	if err != nil {
    		return false, err
    	}
    
    	if position == iptables.Append {
    		c.Rules = append(c.Rules, parsed)
    	} else {
    		c.Rules = append([]*Rule{parsed}, c.Rules...)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Dec 19 01:20:51 UTC 2023
    - 8.5K bytes
    - Viewed (0)
  2. src/go/parser/interface.go

    			// ParseFile API and return a valid (but) empty
    			// *ast.File
    			f = &ast.File{
    				Name:  new(ast.Ident),
    				Scope: ast.NewScope(nil),
    			}
    		}
    
    		p.errors.Sort()
    		err = p.errors.Err()
    	}()
    
    	// parse source
    	p.init(fset, filename, text, mode)
    	f = p.parseFile()
    
    	return
    }
    
    // ParseDir calls [ParseFile] for all files with names ending in ".go" in the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 7.5K bytes
    - Viewed (0)
  3. src/go/parser/performance_test.go

    	b.SetBytes(int64(len(src)))
    	for i := 0; i < b.N; i++ {
    		if _, err := ParseFile(token.NewFileSet(), "", src, ParseComments); err != nil {
    			b.Fatalf("benchmark failed due to parse error: %s", err)
    		}
    	}
    }
    
    func BenchmarkParseOnly(b *testing.B) {
    	b.SetBytes(int64(len(src)))
    	for i := 0; i < b.N; i++ {
    		if _, err := ParseFile(token.NewFileSet(), "", src, ParseComments|SkipObjectResolution); err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 01 22:35:46 UTC 2022
    - 1.2K bytes
    - Viewed (0)
  4. platforms/ide/ide/src/testFixtures/groovy/org/gradle/plugins/ide/fixtures/IdeaFixtures.groovy

    import groovy.xml.XmlSlurper
    import org.gradle.test.fixtures.file.TestFile
    
    class IdeaFixtures {
        static parseFile(TestFile file) {
            file.assertIsFile()
            new XmlSlurper().parse(file)
        }
    
        static IdeaProjectFixture parseIpr(TestFile projectFile) {
            return new IdeaProjectFixture(projectFile, parseFile(projectFile))
        }
    
        static IdeaModuleFixture parseIml(TestFile moduleFile) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Sep 26 14:49:12 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  5. platforms/ide/ide/src/testFixtures/groovy/org/gradle/plugins/ide/eclipse/AbstractEclipseIntegrationTest.groovy

        protected parseProjectFile(Map options) {
            parseFile(options, ".project")
        }
    
        protected parseClasspathFile(Map options) {
            parseFile(options, ".classpath")
        }
    
        protected parseComponentFile(Map options) {
            parseFile(options, ".settings/org.eclipse.wst.common.component")
        }
    
        protected parseFacetFile(Map options) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Sep 26 14:49:12 UTC 2023
    - 3.2K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. 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)
  9. platforms/ide/ide/src/testFixtures/groovy/org/gradle/plugins/ide/AbstractIdeIntegrationTest.groovy

            def file = options?.project ? file(options.project, filename) : file(filename)
            if (options?.print) { println file.text }
            file
        }
    
        protected parseFile(Map options, String filename) {
            def file = getFile(options, filename)
            new XmlSlurper().parse(file)
        }
    
        protected static void createJavaSourceDirs(TestFile buildFile) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Sep 26 14:49:12 UTC 2023
    - 2.5K bytes
    - Viewed (0)
  10. 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)
Back to top