- Sort Score
- Result 10 results
- Languages All
Results 51 - 60 of 248 for Fset (0.1 sec)
-
src/go/types/stdlib_test.go
if err != nil { return "" } defer f.Close() var src [4 << 10]byte // read at most 4KB n, _ := f.Read(src[:]) var first string var s scanner.Scanner s.Init(fset.AddFile("", fset.Base(), n), src[:n], nil /* ignore errors */, scanner.ScanComments) for { _, tok, lit := s.Scan() switch tok { case token.COMMENT: // remove trailing */ of multi-line comment if lit[1] == '*' {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Dec 19 04:39:56 UTC 2023 - 13.7K bytes - Viewed (0) -
src/cmd/compile/internal/types2/struct.go
// only as long as required to hold the tag with the largest index i. Consequently, // if no field has a tag, tags may be nil. func NewStruct(fields []*Var, tags []string) *Struct { var fset objset for _, f := range fields { if f.name != "_" && fset.insert(f) != nil { panic("multiple fields with the same name") } } if len(tags) > len(fields) { panic("more tags than fields") } s := &Struct{fields: fields, tags: tags}
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Feb 29 22:06:18 UTC 2024 - 6.6K bytes - Viewed (0) -
src/go/types/issues_test.go
.*have M5[(]struct{b[.]S; b[.]t}[)] .*want M5[(]struct{b[.]S; t}[)]`}, } fset := token.NewFileSet() test := func(main, b, want string) { re := regexp.MustCompile(want) bpkg := mustTypecheck(b, nil, nil) mast := mustParse(fset, main) conf := Config{Importer: importHelper{pkg: bpkg}} _, err := conf.Check(mast.Name.Name, fset, []*ast.File{mast}, nil) if err == nil { t.Error("Expected failure, but it did not")
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 28.1K bytes - Viewed (0) -
src/go/types/gotype.go
// parse may be called concurrently. func parse(filename string, src any) (*ast.File, error) { if *verbose { fmt.Println(filename) } file, err := parser.ParseFile(fset, filename, src, parserMode) // ok to access fset concurrently if *printAST { ast.Print(fset, file) } return file, err } func parseStdin() (*ast.File, error) { src, err := io.ReadAll(os.Stdin) if err != nil { return nil, err }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Nov 18 17:59:44 UTC 2022 - 8.3K bytes - Viewed (0) -
src/go/types/struct.go
// only as long as required to hold the tag with the largest index i. Consequently, // if no field has a tag, tags may be nil. func NewStruct(fields []*Var, tags []string) *Struct { var fset objset for _, f := range fields { if f.name != "_" && fset.insert(f) != nil { panic("multiple fields with the same name") } } if len(tags) > len(fields) { panic("more tags than fields") } s := &Struct{fields: fields, tags: tags}
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Feb 29 22:06:18 UTC 2024 - 6.1K bytes - Viewed (0) -
src/go/parser/resolver_test.go
if err != nil { t.Fatal(err) } for _, fi := range fis { t.Run(fi.Name(), func(t *testing.T) { fset := token.NewFileSet() path := filepath.Join(dir, fi.Name()) src := readFile(path) // panics on failure var mode Mode file, err := ParseFile(fset, path, src, mode) if err != nil { t.Fatal(err) } // Compare the positions of objects resolved during parsing (fromParser)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Aug 19 17:46:07 UTC 2022 - 4.9K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/internal/analysisutil/util.go
"golang.org/x/tools/internal/aliases" "golang.org/x/tools/internal/analysisinternal" ) // Format returns a string representation of the expression. func Format(fset *token.FileSet, x ast.Expr) string { var b bytes.Buffer printer.Fprint(&b, fset, x) return b.String() } // HasSideEffects reports whether evaluation of e has side effects. func HasSideEffects(info *types.Info, e ast.Expr) bool { safe := true
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 03 02:38:00 UTC 2024 - 3.9K bytes - Viewed (0) -
src/runtime/metrics/description_test.go
src, err := os.ReadFile("doc.go") if err != nil { t.Fatal(err) } fset := token.NewFileSet() f, err := parser.ParseFile(fset, "doc.go", src, parser.ParseComments) if err != nil { t.Fatal(err) } fdoc := f.Doc if fdoc == nil { t.Fatal("no doc comment in doc.go") } pkg, err := doc.NewFromFiles(fset, []*ast.File{f}, "runtime/metrics") if err != nil { t.Fatal(err) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 20 22:54:22 UTC 2023 - 3.9K bytes - Viewed (0) -
src/go/types/named_test.go
func (*Tree[R]) N(r R) R { return r } type Node[T any] struct { *Tree[T] } func (Node[Q]) M(Q) {} type Inst = *Tree[int] ` fset := token.NewFileSet() f := mustParse(fset, src) pkg := NewPackage("p", f.Name.Name) if err := NewChecker(nil, fset, pkg, nil).Files([]*ast.File{f}); err != nil { t.Fatal(err) } firstFieldType := func(n *Named) *Named {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 05 16:29:58 UTC 2024 - 3.9K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/assign/assign.go
continue // expressions may not be equal } if reflect.TypeOf(lhs) != reflect.TypeOf(rhs) { continue // short-circuit the heavy-weight gofmt check } le := analysisutil.Format(pass.Fset, lhs) re := analysisutil.Format(pass.Fset, rhs) if le == re { pass.Report(analysis.Diagnostic{ Pos: stmt.Pos(), Message: fmt.Sprintf("self-assignment of %s to %s", re, le), SuggestedFixes: []analysis.SuggestedFix{
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 23:33:33 UTC 2023 - 2.4K bytes - Viewed (0)