Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 44 for GenDecl (0.23 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go

    			importMap[path] = imported(info, spec)
    		}
    
    		// Add special dot-import declaration:
    		//    import . "·this·"
    		var decls []ast.Decl
    		decls = append(decls, &ast.GenDecl{
    			Tok: token.IMPORT,
    			Specs: []ast.Spec{
    				&ast.ImportSpec{
    					Name: &ast.Ident{Name: "."},
    					Path: &ast.BasicLit{
    						Kind:  token.STRING,
    						Value: strconv.Quote(thispkg),
    					},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 11.2K bytes
    - Viewed (0)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top