- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 449 for parseDir (0.15 sec)
-
src/go/doc/headscan.go
flag.Parse() fset := token.NewFileSet() nheadings := 0 err := filepath.WalkDir(*root, func(path string, info fs.DirEntry, err error) error { if !info.IsDir() { return nil } pkgs, err := parser.ParseDir(fset, path, isGoFile, parser.ParseComments) if err != nil { if *verbose { fmt.Fprintln(os.Stderr, err) } return nil } for _, pkg := range pkgs { d := doc.New(pkg, path, doc.Mode(0))
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Sep 06 21:50:52 UTC 2022 - 2.5K bytes - Viewed (0) -
src/go/parser/parser_test.go
} } func TestParseDir(t *testing.T) { path := "." pkgs, err := ParseDir(token.NewFileSet(), path, dirFilter, 0) if err != nil { t.Fatalf("ParseDir(%s): %v", path, err) } if n := len(pkgs); n != 1 { t.Errorf("got %d packages; want 1", n) } pkg := pkgs["parser"] if pkg == nil { t.Errorf(`package "parser" not found`) return } if n := len(pkg.Files); n != 3 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jan 31 20:26:14 UTC 2024 - 24.6K bytes - Viewed (0) -
src/go/parser/interface.go
// Copyright 2009 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. // This file contains the exported entry points for invoking the parser. package parser import ( "bytes" "errors" "go/ast" "go/token" "io" "io/fs" "os" "path/filepath" "strings" ) // If src != nil, readSource converts src to a []byte if possible;
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 12:02:03 UTC 2023 - 7.5K bytes - Viewed (0) -
src/internal/reflectlite/reflect_mirror_test.go
} return v } func loadTypes(path, pkgName string, v visitor) { fset := token.NewFileSet() filter := func(fi fs.FileInfo) bool { return strings.HasSuffix(fi.Name(), ".go") } pkgs, err := parser.ParseDir(fset, path, filter, 0) if err != nil { panic(err) } pkg := pkgs[pkgName] for _, f := range pkg.Files { ast.Walk(v, f) } } func TestMirrorWithReflect(t *testing.T) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 19 21:11:15 UTC 2024 - 2.8K bytes - Viewed (0) -
src/go/doc/comment_test.go
// license that can be found in the LICENSE file. package doc import ( "bytes" "go/parser" "go/token" "internal/diff" "testing" ) func TestComment(t *testing.T) { fset := token.NewFileSet() pkgs, err := parser.ParseDir(fset, "testdata/pkgdoc", nil, parser.ParseComments) if err != nil { t.Fatal(err) } if pkgs["pkgdoc"] == nil { t.Fatal("missing package pkgdoc") }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Nov 10 06:33:18 UTC 2022 - 3K bytes - Viewed (0) -
src/go/types/gotype.go
errorCount = 0 sequential = false parserMode parser.Mode ) func initParserMode() { if *allErrors { parserMode |= parser.AllErrors } if *printAST { sequential = true } if *printTrace { parserMode |= parser.Trace sequential = true } if *parseComments && (*printAST || *printTrace) { parserMode |= parser.ParseComments } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Nov 18 17:59:44 UTC 2022 - 8.3K bytes - Viewed (0) -
cmd/preferredimports/preferredimports.go
func (a *analyzer) collect(dir string) { if _, ok := a.donePaths[dir]; ok { return } a.donePaths[dir] = nil // Create the AST by parsing src. fs, err := parser.ParseDir(a.fset, dir, nil, parser.AllErrors|parser.ParseComments) if err != nil { fmt.Fprintln(os.Stderr, "ERROR(syntax)", logPrefix, err) a.failed = true return } for _, p := range fs {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Fri Mar 01 06:06:44 UTC 2024 - 7.1K bytes - Viewed (0) -
src/runtime/align_test.go
// that the tables used by the code above are exhaustive. // Parse the whole runtime package, checking that arguments of // appropriate atomic operations are in the list above. fset := token.NewFileSet() m, err := parser.ParseDir(fset, ".", nil, 0) if err != nil { t.Fatalf("parsing runtime failed: %v", err) } pkg := m["runtime"] // Note: ignore runtime_test and main packages
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Feb 08 14:52:12 UTC 2023 - 5.4K bytes - Viewed (0) -
src/go/doc/doc_test.go
t.Fatal(err) } filter = func(fi fs.FileInfo) bool { return isGoFile(fi) && rx.MatchString(fi.Name()) } } // get packages fset := token.NewFileSet() pkgs, err := parser.ParseDir(fset, dataDir, filter, parser.ParseComments) if err != nil { t.Fatal(err) } // test packages for _, pkg := range pkgs { t.Run(pkg.Name, func(t *testing.T) { importPath := dataDir + "/" + pkg.Name
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Apr 11 16:31:52 UTC 2022 - 6.7K bytes - Viewed (0) -
src/cmd/doc/pkg.go
} } for _, name := range pkg.CgoFiles { if name == info.Name() { return true } } return false } fset := token.NewFileSet() pkgs, err := parser.ParseDir(fset, pkg.Dir, include, parser.ParseComments) if err != nil { log.Fatal(err) } // Make sure they are all in one package. if len(pkgs) == 0 { log.Fatalf("no source-code package in directory %s", pkg.Dir) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jan 08 20:15:52 UTC 2024 - 32K bytes - Viewed (0)