Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 74 for parseable (0.12 sec)

  1. 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)
  2. 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)
  3. 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)
  4. src/internal/types/errors/generrordocs.go

    		}
    	})
    	log.Printf("output directory: %s\n", outDir)
    }
    
    func walkCodes(f func(string, *ast.ValueSpec)) {
    	fset := token.NewFileSet()
    	file, err := parser.ParseFile(fset, "codes.go", nil, parser.ParseComments)
    	if err != nil {
    		log.Fatalf("ParseFile failed: %s", err)
    	}
    	conf := Config{Importer: importer.Default()}
    	info := &Info{
    		Types: make(map[ast.Expr]TypeAndValue),
    		Defs:  make(map[*ast.Ident]Object),
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 24 03:14:42 UTC 2023
    - 3K bytes
    - Viewed (0)
  5. tools/docker-builder/dockerfile/parse.go

    	Flags     []string // Any flags such as `--from=...` for `COPY`.
    	Value     []string // The contents of the command (ex: `ubuntu:xenial`)
    }
    
    // parseFile parses a Dockerfile from a filename.
    func parseFile(filename string) ([]Command, error) {
    	file, err := os.Open(filename)
    	if err != nil {
    		return nil, err
    	}
    	defer file.Close()
    
    	res, err := parser.Parse(file)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 17:08:31 UTC 2023
    - 5.8K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/utils/dump_graph.h

        return *this;
      }
    
      // Enable printing of debug information. If 'pretty_form' is set to true,
      // debug information is printed in a more readable 'pretty' form but this
      // pretty form is not parsable (so only for human readability).
      MlirDumpConfig& emit_location_information(bool pretty_form = false) {
        this->op_printing_flags.enableDebugInfo(/*enable=*/true, pretty_form);
        return *this;
      }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sat Dec 24 09:43:29 UTC 2022
    - 2.6K 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/go/ast/commentmap_test.go

    	var buf strings.Builder
    	for _, g := range list {
    		buf.WriteString(g.Text())
    	}
    	return buf.String()
    }
    
    func TestCommentMap(t *testing.T) {
    	fset := token.NewFileSet()
    	f, err := parser.ParseFile(fset, "", src, parser.ParseComments)
    	if err != nil {
    		t.Fatal(err)
    	}
    	cmap := NewCommentMap(fset, f, f.Comments)
    
    	// very correct association of comments
    	for n, list := range cmap {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 09 15:35:30 UTC 2022
    - 3.9K bytes
    - Viewed (0)
  9. pkg/util/kernel/version_test.go

    			},
    			err:      errors.New("failed to read os-release file: open /proc/sys/kernel/osrelease: failed to read file"),
    			expected: nil,
    		},
    		{
    			name: "version not parsable",
    			readFileFunc: func(_ string) ([]byte, error) {
    				return []byte("5-15-0"), nil
    			},
    			err:      errors.New("failed to parse kernel version: illegal version string \"5-15-0\""),
    			expected: nil,
    		},
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 27 19:24:34 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  10. src/go/ast/issues_test.go

    	for _, src := range []string{
    		`package p; func _()`,
    		`package p; func _() {`,
    		`package p; func _() { _ = 0`,
    		`package p; func _() { _ = 0 }`,
    	} {
    		fset := token.NewFileSet()
    		f, _ := parser.ParseFile(fset, "", src, parser.AllErrors)
    		if f == nil {
    			panic("invalid test setup: parser didn't return an AST")
    		}
    
    		// find corresponding token.File
    		var tf *token.File
    		fset.Iterate(func(f *token.File) bool {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 25 13:57:33 UTC 2023
    - 3.5K bytes
    - Viewed (0)
Back to top