- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 51 for GenDecl (0.48 sec)
-
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/doc/doc.go
type Value struct { Doc string Names []string // var or const names in declaration order Decl *ast.GenDecl order int } // Type is the documentation for a type declaration. type Type struct { Doc string Name string Decl *ast.GenDecl // associated declarations Consts []*Value // sorted list of constants of (mostly) this type
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 12:02:03 UTC 2023 - 11.2K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go
} case *ast.FuncLit: // nop case *ast.FuncType: if n.Func != 0 { children = append(children, tok(n.Func, len("func"))) } case *ast.GenDecl: children = append(children, tok(n.TokPos, len(n.Tok.String()))) if n.Lparen != 0 { children = append(children, tok(n.Lparen, len("(")), tok(n.Rparen, len(")"))) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 18 21:28:13 UTC 2023 - 15.9K 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/parser/parser_test.go
if err != nil { t.Fatal(err) } // RHS refers to undefined globals; LHS does not. as := f.Decls[0].(*ast.FuncDecl).Body.List[0].(*ast.DeclStmt).Decl.(*ast.GenDecl).Specs[0].(*ast.ValueSpec) for _, v := range as.Values { id := v.(*ast.Ident) if id.Obj != nil { t.Errorf("rhs %s has Obj, should not", id.Name) } } for _, id := range as.Names {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jan 31 20:26:14 UTC 2024 - 24.6K 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)