Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 151 for Fset (0.14 sec)

  1. src/go/parser/error_test.go

    func getFile(fset *token.FileSet, filename string) (file *token.File) {
    	fset.Iterate(func(f *token.File) bool {
    		if f.Name() == filename {
    			if file != nil {
    				panic(filename + " used multiple times")
    			}
    			file = f
    		}
    		return true
    	})
    	return file
    }
    
    func getPos(fset *token.FileSet, filename string, offset int) token.Pos {
    	if f := getFile(fset, filename); f != nil {
    		return f.Pos(offset)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 27 19:47:49 UTC 2022
    - 5.9K bytes
    - Viewed (0)
  2. src/go/ast/print.go

    // struct fields are never printed.
    func Fprint(w io.Writer, fset *token.FileSet, x any, f FieldFilter) error {
    	return fprint(w, fset, x, f)
    }
    
    func fprint(w io.Writer, fset *token.FileSet, x any, f FieldFilter) (err error) {
    	// setup printer
    	p := printer{
    		output: w,
    		fset:   fset,
    		filter: f,
    		ptrmap: make(map[any]int),
    		last:   '\n', // force printing of line number on first line
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  3. src/go/doc/testdata/template.txt

    {{range .}}	{{synopsis .Doc}}
    	{{node .Decl $.FSet}}
    
    {{end}}{{end}}{{/*
    
    */}}{{with .Vars}}
    VARIABLES
    {{range .}}	{{synopsis .Doc}}
    	{{node .Decl $.FSet}}
    
    {{end}}{{end}}{{/*
    
    */}}{{with .Funcs}}
    FUNCTIONS
    {{range .}}	{{synopsis .Doc}}
    	{{node .Decl $.FSet}}
    
    {{end}}{{end}}{{/*
    
    */}}{{with .Types}}
    TYPES
    {{range .}}	{{synopsis .Doc}}
    	{{node .Decl $.FSet}}
    
    {{range .Consts}}	{{synopsis .Doc}}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 1.1K bytes
    - Viewed (0)
  4. src/go/doc/example_test.go

    func ExampleGreet_world() {
    	Greet("world")
    }
    `
    
    	// Create the AST by parsing src and test.
    	fset := token.NewFileSet()
    	files := []*ast.File{
    		mustParse(fset, "src.go", src),
    		mustParse(fset, "src_test.go", test),
    	}
    
    	// Compute package documentation with examples.
    	p, err := doc.NewFromFiles(fset, files, "example.com/p")
    	if err != nil {
    		panic(err)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 10 16:17:51 UTC 2022
    - 9.6K bytes
    - Viewed (0)
  5. src/go/types/example_test.go

    	pkg, err := conf.Check("temperature", fset, []*ast.File{f}, nil)
    	if err != nil {
    		log.Fatal(err)
    	}
    
    	// Print the method sets of Celsius and *Celsius.
    	celsius := pkg.Scope().Lookup("Celsius").Type()
    	for _, t := range []types.Type{celsius, types.NewPointer(celsius)} {
    		fmt.Printf("Method set of %s:\n", t)
    		mset := types.NewMethodSet(t)
    		for i := 0; i < mset.Len(); i++ {
    			fmt.Println(mset.At(i))
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  6. src/runtime/align_test.go

    	conf := types.Config{Importer: importer.Default()}
    	_, err = conf.Check("runtime", fset, files, &info)
    	if err != nil {
    		t.Fatalf("typechecking runtime failed: %v", err)
    	}
    
    	// Analyze all atomic.*64 callsites.
    	v := Visitor{t: t, fset: fset, types: info.Types, checked: checked}
    	ast.Walk(&v, pkg)
    }
    
    type Visitor struct {
    	fset    *token.FileSet
    	types   map[ast.Expr]types.TypeAndValue
    	checked map[string]bool
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 08 14:52:12 UTC 2023
    - 5.4K bytes
    - Viewed (0)
  7. src/go/types/self_test.go

    	testenv.MustHaveGoBuild(t) // The Go command is needed for the importer to determine the locations of stdlib .a files.
    
    	fset := token.NewFileSet()
    	files, err := pkgFiles(fset, ".")
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	conf := Config{Importer: importer.Default()}
    	_, err = conf.Check("go/types", fset, files, nil)
    	if err != nil {
    		t.Fatal(err)
    	}
    }
    
    func BenchmarkCheck(b *testing.B) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 23 19:39:00 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  8. src/cmd/internal/dwarf/putvarabbrevgen_test.go

    		t.Error(pvagenfile + " is out of date")
    	}
    
    }
    
    func pvagenerate(t *testing.T) string {
    	var fset token.FileSet
    	f, err := parser.ParseFile(&fset, "./dwarf.go", nil, parser.ParseComments)
    	if err != nil {
    		t.Fatal(err)
    	}
    	cm := ast.NewCommentMap(&fset, f, f.Comments)
    	abbrevs := make(map[string]int)
    	funcs := map[string]ast.Stmt{}
    	for _, decl := range f.Decls {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:45:07 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  9. src/go/ast/import.go

    			lastSpec := d.Specs[len(d.Specs)-1]
    			lastLine := lineAt(fset, lastSpec.Pos())
    			rParenLine := lineAt(fset, d.Rparen)
    			for rParenLine > lastLine+1 {
    				rParenLine--
    				fset.File(d.Rparen).MergeLine(rParenLine)
    			}
    		}
    	}
    }
    
    func lineAt(fset *token.FileSet, pos token.Pos) int {
    	return fset.PositionFor(pos, false).Line
    }
    
    func importPath(s Spec) string {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  10. src/cmd/gofmt/long_test.go

    	nfiles  int // number of files processed
    )
    
    func gofmt(fset *token.FileSet, filename string, src *bytes.Buffer) error {
    	f, _, _, err := parse(fset, filename, src.Bytes(), false)
    	if err != nil {
    		return err
    	}
    	ast.SortImports(fset, f)
    	src.Reset()
    	return (&printer.Config{Mode: printerMode, Tabwidth: tabWidth}).Fprint(src, fset, f)
    }
    
    func testFile(t *testing.T, b1, b2 *bytes.Buffer, filename string) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 20:27:28 UTC 2023
    - 3.8K bytes
    - Viewed (0)
Back to top