Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 248 for Fset (0.57 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go

    		return nil, nil // doesn't use cgo
    	}
    
    	cgofiles, info, err := typeCheckCgoSourceFiles(pass.Fset, pass.Pkg, pass.Files, pass.TypesInfo, pass.TypesSizes)
    	if err != nil {
    		return nil, err
    	}
    	for _, f := range cgofiles {
    		checkCgo(pass.Fset, f, info, pass.Reportf)
    	}
    	return nil, nil
    }
    
    func checkCgo(fset *token.FileSet, f *ast.File, info *types.Info, reportf func(token.Pos, string, ...interface{})) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 11.2K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go

    // with context specified by the -c flag.
    func PrintPlain(fset *token.FileSet, diag analysis.Diagnostic) {
    	posn := fset.Position(diag.Pos)
    	fmt.Fprintf(os.Stderr, "%s: %s\n", posn, diag.Message)
    
    	// -c=N: show offending line plus N lines of context.
    	if Context >= 0 {
    		posn := fset.Position(diag.Pos)
    		end := fset.Position(diag.End)
    		if !end.IsValid() {
    			end = posn
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 19:00:13 UTC 2024
    - 12.1K bytes
    - Viewed (0)
  3. src/go/internal/srcimporter/srcimporter.go

    // os functions. The file set is used to track position information of package
    // files; and imported packages are added to the packages map.
    func New(ctxt *build.Context, fset *token.FileSet, packages map[string]*types.Package) *Importer {
    	return &Importer{
    		ctxt:     ctxt,
    		fset:     fset,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 23 18:54:32 UTC 2022
    - 8.2K bytes
    - Viewed (0)
  4. src/go/ast/issues_test.go

    		`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 {
    			tf = f
    			return true
    		})
    		tfEnd := tf.Base() + tf.Size()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 25 13:57:33 UTC 2023
    - 3.5K bytes
    - Viewed (0)
  5. src/go/types/api_test.go

    var nopos token.Pos
    
    func mustParse(fset *token.FileSet, src string) *ast.File {
    	f, err := parser.ParseFile(fset, pkgName(src), src, parser.ParseComments)
    	if err != nil {
    		panic(err) // so we don't need to pass *testing.T
    	}
    	return f
    }
    
    func typecheck(src string, conf *Config, info *Info) (*Package, error) {
    	fset := token.NewFileSet()
    	f := mustParse(fset, src)
    	if conf == nil {
    		conf = &Config{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 94.2K bytes
    - Viewed (0)
  6. src/go/types/commentMap_test.go

    // recorded position is unknown (line, col = 0, 0).
    // If there are no matching comments, the result is nil.
    func commentMap(src []byte, rx *regexp.Regexp) (res map[int][]comment) {
    	fset := token.NewFileSet()
    	file := fset.AddFile("", -1, len(src))
    
    	var s scanner.Scanner
    	s.Init(file, src, nil, scanner.ScanComments)
    	var prev token.Pos // position of last non-comment, non-semicolon token
    
    	for {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:54:27 UTC 2023
    - 3K bytes
    - Viewed (0)
  7. src/go/ast/resolve.go

    // The result is a package node and a [scanner.ErrorList] if there were errors.
    //
    // Deprecated: use the type checker [go/types] instead; see [Object].
    func NewPackage(fset *token.FileSet, files map[string]*File, importer Importer, universe *Scope) (*Package, error) {
    	var p pkgBuilder
    	p.fset = fset
    
    	// complete package scope
    	pkgName := ""
    	pkgScope := NewScope(universe)
    	for _, file := range files {
    		// package names must match
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 5.4K bytes
    - Viewed (0)
  8. 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)
  9. src/cmd/vendor/golang.org/x/tools/internal/aliases/aliases_go122.go

    	//     setting caused by os.Setenv("GODEBUG"), as happens in
    	//     many tests. Therefore any attempt to cache the result
    	//     is just incorrect.
    	fset := token.NewFileSet()
    	f, _ := parser.ParseFile(fset, "a.go", "package p; type A = int", 0)
    	pkg, _ := new(types.Config).Check("p", fset, []*ast.File{f}, nil)
    	_, enabled := pkg.Scope().Lookup("A").Type().(*types.Alias)
    	return enabled
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 2K bytes
    - Viewed (0)
  10. src/internal/types/errors/generrordocs.go

    			log.Fatalf("os.WriteFile: %s\n", err)
    		}
    	})
    	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{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 24 03:14:42 UTC 2023
    - 3K bytes
    - Viewed (0)
Back to top