Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 69 for Fset (0.06 sec)

  1. src/go/ast/walk_test.go

    	// yield for sibling nodes even after yield had returned false. With that
    	// 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)
  2. 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)
  3. src/cmd/cover/cover.go

    func (p *Package) annotateFile(name string, fd io.Writer) {
    	fset := token.NewFileSet()
    	content, err := os.ReadFile(name)
    	if err != nil {
    		log.Fatalf("cover: %s: %s", name, err)
    	}
    	parsedFile, err := parser.ParseFile(fset, name, content, parser.ParseComments)
    	if err != nil {
    		log.Fatalf("cover: %s: %s", name, err)
    	}
    
    	file := &File{
    		fset:    fset,
    		name:    name,
    		content: content,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 19:41:17 UTC 2024
    - 34.5K bytes
    - Viewed (0)
  4. src/go/internal/gcimporter/gcimporter.go

    				return
    			}
    			s := string(data)
    			s = s[:strings.LastIndex(s, "\n$$\n")]
    
    			input := pkgbits.NewPkgDecoder(id, s)
    			pkg = readUnifiedPackage(fset, nil, packages, input)
    		case 'i':
    			pkg, err = iImportData(fset, packages, buf, id)
    		default:
    			err = fmt.Errorf("import %q: old binary export format no longer supported (recompile library)", path)
    		}
    
    	default:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/copylock/copylock.go

    func checkCopyLocksAssign(pass *analysis.Pass, as *ast.AssignStmt) {
    	for i, x := range as.Rhs {
    		if path := lockPathRhs(pass, x); path != nil {
    			pass.ReportRangef(x, "assignment copies lock value to %v: %v", analysisutil.Format(pass.Fset, as.Lhs[i]), path)
    		}
    	}
    }
    
    // checkCopyLocksGenDecl checks whether lock is copied
    // in variable declaration.
    func checkCopyLocksGenDecl(pass *analysis.Pass, gd *ast.GenDecl) {
    	if gd.Tok != token.VAR {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  6. src/go/types/check_test.go

    )
    
    var fset = token.NewFileSet()
    
    func parseFiles(t *testing.T, filenames []string, srcs [][]byte, mode parser.Mode) ([]*ast.File, []error) {
    	var files []*ast.File
    	var errlist []error
    	for i, filename := range filenames {
    		file, err := parser.ParseFile(fset, filename, srcs[i], mode)
    		if file == nil {
    			t.Fatalf("%s: %s", filename, err)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 19:45:33 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  7. src/cmd/cgo/godefs.go

    				id.Name = gofmt(def)
    			}
    		}
    	}
    
    	conf.Fprint(&buf, fset, f.AST)
    
    	return buf.String()
    }
    
    var gofmtBuf strings.Builder
    
    // gofmt returns the gofmt-formatted string for an AST node.
    func gofmt(n interface{}) string {
    	gofmtBuf.Reset()
    	err := printer.Fprint(&gofmtBuf, fset, n)
    	if err != nil {
    		return "<" + err.Error() + ">"
    	}
    	return gofmtBuf.String()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 15:50:06 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  8. src/go/build/read.go

    		for r.err == nil && !r.eof {
    			r.readByte()
    		}
    		info.header = r.buf
    	}
    	if r.err != nil {
    		return r.err
    	}
    
    	if info.fset == nil {
    		return nil
    	}
    
    	// Parse file header & record imports.
    	info.parsed, info.parseErr = parser.ParseFile(info.fset, info.name, info.header, parser.ImportsOnly|parser.ParseComments)
    	if info.parseErr != nil {
    		return nil
    	}
    
    	hasEmbed := false
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 16:25:21 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/directive/directive.go

    		if err := checkOtherFile(pass, name); err != nil {
    			return nil, err
    		}
    	}
    	for _, name := range pass.IgnoredFiles {
    		if strings.HasSuffix(name, ".go") {
    			f, err := parser.ParseFile(pass.Fset, name, nil, parser.ParseComments)
    			if err != nil {
    				// Not valid Go source code - not our job to diagnose, so ignore.
    				continue
    			}
    			checkGoFile(pass, f)
    		} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  10. src/go/types/api.go

    // behavior if ignored.
    type Error struct {
    	Fset *token.FileSet // file set for interpretation of Pos
    	Pos  token.Pos      // error position
    	Msg  string         // error message
    	Soft bool           // if set, error is "soft"
    
    	// go116code is a future API, unexported as the set of error codes is large
    	// and likely to change significantly during experimentation. Tools wishing
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 19:57:43 UTC 2024
    - 17.2K bytes
    - Viewed (0)
Back to top