- Sort Score
- Result 10 results
- Languages All
Results 11 - 18 of 18 for GenDecl (0.17 sec)
-
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) -
src/go/ast/example_test.go
// and AST nodes. cmap := ast.NewCommentMap(fset, f, f.Comments) // Remove the first variable declaration from the list of declarations. for i, decl := range f.Decls { if gen, ok := decl.(*ast.GenDecl); ok && gen.Tok == token.VAR { copy(f.Decls[i:], f.Decls[i+1:]) f.Decls = f.Decls[:len(f.Decls)-1] break } } // Use the comment map to filter comments that don't belong anymore
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/labels.go
} var stmtBranches func(ast.Stmt) stmtBranches = func(s ast.Stmt) { switch s := s.(type) { case *ast.DeclStmt: if d, _ := s.Decl.(*ast.GenDecl); d != nil && d.Tok == token.VAR { recordVarDecl(d.Pos()) } case *ast.LabeledStmt: // declare non-blank label if name := s.Label.Name; name != "_" {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 7.2K bytes - Viewed (0) -
src/go/ast/walk.go
Walk(v, n.Name) if n.TypeParams != nil { Walk(v, n.TypeParams) } Walk(v, n.Type) if n.Comment != nil { Walk(v, n.Comment) } case *BadDecl: // nothing to do case *GenDecl: if n.Doc != nil { Walk(v, n.Doc) } walkList(v, n.Specs) case *FuncDecl: if n.Doc != nil { Walk(v, n.Doc) } if n.Recv != nil { Walk(v, n.Recv) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 16 16:34:10 UTC 2024 - 6.4K bytes - Viewed (0) -
src/go/ast/import.go
// It also removes duplicate imports when it is possible to do so without data loss. func SortImports(fset *token.FileSet, f *File) { for _, d := range f.Decls { d, ok := d.(*GenDecl) if !ok || d.Tok != token.IMPORT { // Not an import declaration, so we're done. // Imports are always first. break } if !d.Lparen.IsValid() { // Not a block: sorted by default. continue
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/go/doc/exports.go
for _, s := range list { if r.filterSpec(s) { list[j] = s j++ } } return list[0:j] } func (r *reader) filterDecl(decl ast.Decl) bool { switch d := decl.(type) { case *ast.GenDecl: d.Specs = r.filterSpecList(d.Specs, d.Tok) return len(d.Specs) > 0 case *ast.FuncDecl: // ok to filter these methods early because any // conflicting method will be filtered here, too -
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 01 18:18:07 UTC 2022 - 8.5K bytes - Viewed (0)