Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 51 for GenDecl (0.12 sec)

  1. src/cmd/cgo/ast.go

    	f.NamePos = make(map[*Name]token.Pos)
    
    	// In ast1, find the import "C" line and get any extra C preamble.
    	sawC := false
    	for _, decl := range ast1.Decls {
    		switch decl := decl.(type) {
    		case *ast.GenDecl:
    			for _, spec := range decl.Specs {
    				s, ok := spec.(*ast.ImportSpec)
    				if !ok || s.Path.Value != `"C"` {
    					continue
    				}
    				sawC = true
    				if s.Name != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 07 16:54:27 UTC 2023
    - 14.3K bytes
    - Viewed (0)
  2. src/go/doc/filter.go

    	if fields != nil {
    		for _, field := range fields.List {
    			for _, name := range field.Names {
    				if f(name.Name) {
    					return true
    				}
    			}
    		}
    	}
    	return false
    }
    
    func matchDecl(d *ast.GenDecl, f Filter) bool {
    	for _, d := range d.Specs {
    		switch v := d.(type) {
    		case *ast.ValueSpec:
    			for _, name := range v.Names {
    				if f(name.Name) {
    					return true
    				}
    			}
    		case *ast.TypeSpec:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 01 18:18:07 UTC 2022
    - 2.2K bytes
    - Viewed (0)
  3. src/go/doc/reader.go

    // predeclared) type. The namedType for a type name is always found via
    // reader.lookupType.
    type namedType struct {
    	doc  string       // doc comment for type
    	name string       // type name
    	decl *ast.GenDecl // nil if declaration hasn't been seen yet
    
    	isEmbedded bool        // true if this type is embedded
    	isStruct   bool        // true if this type is a struct
    	embedded   embeddedSet // true if the embedded type is a pointer
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 27.5K bytes
    - Viewed (0)
  4. 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)
  5. src/go/ast/ast.go

    	}
    )
    
    // Pos and End implementations for declaration nodes.
    
    func (d *BadDecl) Pos() token.Pos  { return d.From }
    func (d *GenDecl) Pos() token.Pos  { return d.TokPos }
    func (d *FuncDecl) Pos() token.Pos { return d.Type.Pos() }
    
    func (d *BadDecl) End() token.Pos { return d.To }
    func (d *GenDecl) End() token.Pos {
    	if d.Rparen.IsValid() {
    		return d.Rparen + 1
    	}
    	return d.Specs[0].End()
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 35.6K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top