- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 14 for GenDecl (0.22 sec)
-
src/go/ast/commentmap_test.go
" 5: *ast.Ident": " the name is p\n", " 8: *ast.GenDecl": "imports\n", " 9: *ast.ImportSpec": "bytes\n", "10: *ast.ImportSpec": "fmt\n", "16: *ast.GenDecl": "T\nalso associated with T\n", "17: *ast.Field": "associated with a, b, c\n", "19: *ast.Field": "associated with x, y\nfloat values\n", "20: *ast.Field": "complex value\n", "25: *ast.GenDecl": "x\nx = 0\nalso associated with x\n",
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/token/example_test.go
pos := decl.Pos() relPosition := fset.Position(pos) absPosition := fset.PositionFor(pos, false) // Either a FuncDecl or GenDecl, since we exit on error. kind := "func" if gen, ok := decl.(*ast.GenDecl); ok { kind = gen.Tok.String() } // If the relative and absolute positions differ, show both. fmtPosition := relPosition.String() if relPosition != absPosition {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Oct 09 22:09:31 UTC 2023 - 1.7K bytes - Viewed (0) -
src/go/printer/performance_test.go
fileNode = file fileSize = int64(len(src)) for _, decl := range file.Decls { // The first global variable, which is pretty short: // // var unresolved = new(ast.Object) if decl, ok := decl.(*ast.GenDecl); ok && decl.Tok == token.VAR { declNode = decl declSize = int64(fset.Position(decl.End()).Offset - fset.Position(decl.Pos()).Offset) break } } } func BenchmarkPrintFile(b *testing.B) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 09 15:10:10 UTC 2022 - 1.8K bytes - Viewed (0) -
src/internal/types/errors/generrordocs.go
} _, err = conf.Check("types", fset, []*ast.File{file}, info) if err != nil { log.Fatalf("Check failed: %s", err) } for _, decl := range file.Decls { decl, ok := decl.(*ast.GenDecl) if !ok || decl.Tok != token.CONST { continue } for _, spec := range decl.Specs { spec, ok := spec.(*ast.ValueSpec) if !ok || len(spec.Names) == 0 { continue }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 24 03:14:42 UTC 2023 - 3K bytes - Viewed (0) -
src/cmd/cgo/godefs.go
// except in the definition (handled at end of function). refName := make(map[*ast.Expr]*Name) for _, r := range f.Ref { refName[r.Expr] = r.Name } for _, d := range f.AST.Decls { d, ok := d.(*ast.GenDecl) if !ok || d.Tok != token.TYPE { continue } for _, s := range d.Specs { s := s.(*ast.TypeSpec) n := refName[&s.Type] if n != nil && n.Mangle != "" { override[n.Mangle] = s.Name.Name }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 20 15:50:06 UTC 2024 - 3.2K bytes - Viewed (0) -
src/cmd/internal/goobj/mkbuiltin.go
log.Fatal("unexpected function body") } declName := pkg + "." + decl.Name.Name decls[declName] = true fmt.Fprintf(w, "{%q, 1},\n", declName) // functions are ABIInternal (1) case *ast.GenDecl: if decl.Tok == token.IMPORT { continue } if decl.Tok != token.VAR { log.Fatal("unhandled declaration kind", decl.Tok) } for _, spec := range decl.Specs { spec := spec.(*ast.ValueSpec)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 23:33:27 UTC 2023 - 3.8K bytes - Viewed (0) -
src/go/format/format.go
ast.SortImports(fset, file) } return format(fset, file, sourceAdj, indentAdj, src, config) } func hasUnsortedImports(file *ast.File) bool { for _, d := range file.Decls { d, ok := d.(*ast.GenDecl) if !ok || d.Tok != token.IMPORT { // Not an import declaration, so we're done. // Imports are always first. return false } if d.Lparen.IsValid() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 12:02:03 UTC 2023 - 4.3K bytes - Viewed (0) -
src/internal/types/errors/codes_test.go
Uses: make(map[*ast.Ident]Object), } _, err = conf.Check("types", fset, []*ast.File{file}, info) if err != nil { t.Fatal(err) } for _, decl := range file.Decls { decl, ok := decl.(*ast.GenDecl) if !ok || decl.Tok != token.CONST { continue } for _, spec := range decl.Specs { spec, ok := spec.(*ast.ValueSpec) if !ok || len(spec.Names) == 0 { continue }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Oct 18 20:41:45 UTC 2022 - 4.9K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/ast/inspector/typeof.go
case *ast.ForStmt: return 1 << nForStmt case *ast.FuncDecl: return 1 << nFuncDecl case *ast.FuncLit: return 1 << nFuncLit case *ast.FuncType: return 1 << nFuncType case *ast.GenDecl: return 1 << nGenDecl case *ast.GoStmt: return 1 << nGoStmt case *ast.Ident: return 1 << nIdent case *ast.IfStmt: return 1 << nIfStmt case *ast.ImportSpec: return 1 << nImportSpec
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 18 21:28:13 UTC 2023 - 4.8K bytes - Viewed (0) -
src/cmd/compile/internal/typecheck/mkbuiltin.go
log.Fatal("methods unsupported") } if decl.Body != nil { log.Fatal("unexpected function body") } fmt.Fprintf(w, "{%q, funcTag, %d},\n", decl.Name.Name, interner.intern(decl.Type)) case *ast.GenDecl: if decl.Tok == token.IMPORT { if len(decl.Specs) != 1 || decl.Specs[0].(*ast.ImportSpec).Path.Value != "\"unsafe\"" { log.Fatal("runtime cannot import other package") } continue }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jan 26 21:56:49 UTC 2023 - 6K bytes - Viewed (0)