- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 274 for Fset (0.05 sec)
-
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) -
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) -
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) -
src/go/ast/example_test.go
src := ` package main func main() { println("Hello, World!") } ` // Create the AST by parsing src. fset := token.NewFileSet() // positions are relative to fset f, err := parser.ParseFile(fset, "", src, 0) if err != nil { panic(err) } // Print the AST. ast.Print(fset, f) // Output: // 0 *ast.File { // 1 . Package: 2:1 // 2 . Name: *ast.Ident {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 15 21:44:50 UTC 2024 - 6.1K bytes - Viewed (0) -
src/go/types/eval.go
// complete position information relative to the provided file // set. // // The meaning of the parameters fset, pkg, and pos is the // same as in [CheckExpr]. An error is returned if expr cannot // be parsed successfully, or the resulting expr AST cannot be // type-checked. func Eval(fset *token.FileSet, pkg *Package, pos token.Pos, expr string) (_ TypeAndValue, err error) { // parse expressions
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 12:02:03 UTC 2023 - 3.1K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/cfg/cfg.go
return b.cfg } func (b *Block) String() string { return fmt.Sprintf("block %d (%s)", b.Index, b.comment(nil)) } func (b *Block) comment(fset *token.FileSet) string { s := b.Kind.String() if fset != nil && b.Stmt != nil { s = fmt.Sprintf("%s@L%d", s, fset.Position(b.Stmt.Pos()).Line) } return s } // Return returns the return statement at the end of this block if present, nil // otherwise. //
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 7.7K bytes - Viewed (0) -
src/go/types/format.go
var fset *token.FileSet var qf Qualifier if check != nil { fset = check.fset qf = check.qualifier } return sprintf(fset, qf, false, format, args...) } func (check *Checker) trace(pos token.Pos, format string, args ...any) { fmt.Printf("%s:\t%s%s\n", check.fset.Position(pos), strings.Repeat(". ", check.indent), sprintf(check.fset, check.qualifier, true, format, args...), )
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 3.5K bytes - Viewed (0) -
src/go/ast/commentmap_test.go
return buf.String() } func TestCommentMap(t *testing.T) { fset := token.NewFileSet() f, err := parser.ParseFile(fset, "", src, parser.ParseComments) if err != nil { t.Fatal(err) } cmap := NewCommentMap(fset, f, f.Comments) // very correct association of comments for n, list := range cmap { key := fmt.Sprintf("%2d: %T", fset.Position(n.Pos()).Line, n) got := ctext(list) want := res[key]
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 09 15:35:30 UTC 2022 - 3.9K bytes - Viewed (0) -
src/go/types/resolver_test.go
goto L2 } L2: } `, } pkgnames := []string{ "fmt", "math", } // parse package files fset := token.NewFileSet() var files []*ast.File for _, src := range sources { files = append(files, mustParse(fset, src)) } // resolve and type-check package AST importer := new(resolveTestImporter) conf := Config{Importer: importer}
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 4.5K bytes - Viewed (0) -
src/go/types/eval_test.go
} } func TestEvalBasic(t *testing.T) { fset := token.NewFileSet() for _, typ := range Typ[Bool : String+1] { testEval(t, fset, nil, nopos, typ.Name(), typ, "", "") } } func TestEvalComposite(t *testing.T) { fset := token.NewFileSet() for _, test := range independentTestTypes { testEval(t, fset, nil, nopos, test.src, nil, test.str, "") } } func TestEvalArith(t *testing.T) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Apr 15 19:56:15 UTC 2024 - 8.3K bytes - Viewed (0)