Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 37 for ImportSpec (0.27 sec)

  1. src/go/types/generate_test.go

    func renameImportPath(f *ast.File, renames ...string) {
    	m := makeRenameMap(renames...)
    	ast.Inspect(f, func(n ast.Node) bool {
    		switch n := n.(type) {
    		case *ast.ImportSpec:
    			if n.Path.Kind != token.STRING {
    				panic("invalid import path")
    			}
    			m.rename(&n.Path.Value)
    			return false
    		}
    		return true
    	})
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 16.5K bytes
    - Viewed (0)
  2. src/go/ast/scope.go

    func (obj *Object) Pos() token.Pos {
    	name := obj.Name
    	switch d := obj.Decl.(type) {
    	case *Field:
    		for _, n := range d.Names {
    			if n.Name == name {
    				return n.Pos()
    			}
    		}
    	case *ImportSpec:
    		if d.Name != nil && d.Name.Name == name {
    			return d.Name.Pos()
    		}
    		return d.Path.Pos()
    	case *ValueSpec:
    		for _, n := range d.Names {
    			if n.Name == name {
    				return n.Pos()
    			}
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/go/ast/inspector/typeof.go

    		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
    	case *ast.IncDecStmt:
    		return 1 << nIncDecStmt
    	case *ast.IndexExpr:
    		return 1 << nIndexExpr
    	case *ast.IndexListExpr:
    		return 1 << nIndexListExpr
    	case *ast.InterfaceType:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 18 21:28:13 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  4. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go

    		}
    
    		// 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)
  5. src/cmd/compile/internal/typecheck/mkbuiltin.go

    			}
    			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
    			}
    			if decl.Tok != token.VAR {
    				log.Fatal("unhandled declaration kind", decl.Tok)
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jan 26 21:56:49 UTC 2023
    - 6K bytes
    - Viewed (0)
  6. src/go/types/api.go

    	// Implicits maps nodes to their implicitly declared objects, if any.
    	// The following node and object types may appear:
    	//
    	//     node               declared object
    	//
    	//     *ast.ImportSpec    *PkgName for imports without renames
    	//     *ast.CaseClause    type-specific *Var for each type switch case clause (incl. default)
    	//     *ast.Field         anonymous parameter *Var (incl. unnamed results)
    	//
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 19:57:43 UTC 2024
    - 17.2K bytes
    - Viewed (0)
  7. src/go/ast/walk.go

    	case *RangeStmt:
    		if n.Key != nil {
    			Walk(v, n.Key)
    		}
    		if n.Value != nil {
    			Walk(v, n.Value)
    		}
    		Walk(v, n.X)
    		Walk(v, n.Body)
    
    	// Declarations
    	case *ImportSpec:
    		if n.Doc != nil {
    			Walk(v, n.Doc)
    		}
    		if n.Name != nil {
    			Walk(v, n.Name)
    		}
    		Walk(v, n.Path)
    		if n.Comment != nil {
    			Walk(v, n.Comment)
    		}
    
    	case *ValueSpec:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:34:10 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  8. src/go/doc/exports.go

    		r.filterType(nil, t.Key)
    		r.filterType(nil, t.Value)
    	case *ast.ChanType:
    		r.filterType(nil, t.Value)
    	}
    }
    
    func (r *reader) filterSpec(spec ast.Spec) bool {
    	switch s := spec.(type) {
    	case *ast.ImportSpec:
    		// always keep imports so we can collect them
    		return true
    	case *ast.ValueSpec:
    		s.Values = filterExprList(s.Values, token.IsExported, true)
    		if len(s.Values) > 0 || s.Type == nil && len(s.Values) == 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 01 18:18:07 UTC 2022
    - 8.5K bytes
    - Viewed (0)
  9. src/cmd/go/internal/modindex/build_read.go

    	}
    
    	hasEmbed := false
    	for _, decl := range info.parsed.Decls {
    		d, ok := decl.(*ast.GenDecl)
    		if !ok {
    			continue
    		}
    		for _, dspec := range d.Specs {
    			spec, ok := dspec.(*ast.ImportSpec)
    			if !ok {
    				continue
    			}
    			quoted := spec.Path.Value
    			path, err := strconv.Unquote(quoted)
    			if err != nil {
    				return fmt.Errorf("parser returned invalid quoted string: <%s>", quoted)
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 23 10:10:21 UTC 2023
    - 13K bytes
    - Viewed (0)
  10. src/go/ast/filter.go

    			for _, d := range decls {
    				if d != nil {
    					decls[i] = d
    					i++
    				}
    			}
    			decls = decls[0:i]
    		}
    	}
    
    	// Collect import specs from all package files.
    	var imports []*ImportSpec
    	if mode&FilterImportDuplicates != 0 {
    		seen := make(map[string]bool)
    		for _, filename := range filenames {
    			f := pkg.Files[filename]
    			for _, imp := range f.Imports {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 13.3K bytes
    - Viewed (0)
Back to top