Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for GenDecl (0.14 sec)

  1. src/go/printer/nodes.go

    		p.print("BadDecl")
    	case *ast.GenDecl:
    		p.genDecl(d)
    	case *ast.FuncDecl:
    		p.funcDecl(d)
    	default:
    		panic("unreachable")
    	}
    }
    
    // ----------------------------------------------------------------------------
    // Files
    
    func declToken(decl ast.Decl) (tok token.Token) {
    	tok = token.ILLEGAL
    	switch d := decl.(type) {
    	case *ast.GenDecl:
    		tok = d.Tok
    	case *ast.FuncDecl:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 17 18:53:17 UTC 2023
    - 52.6K bytes
    - Viewed (0)
  2. src/go/printer/testdata/parser.go

    	p.declare(spec, p.topScope, ast.Var, idents...)
    
    	return spec
    }
    
    func (p *parser) parseGenDecl(keyword token.Token, f parseSpecFunction) *ast.GenDecl {
    	if p.trace {
    		defer un(trace(p, "GenDecl("+keyword.String()+")"))
    	}
    
    	doc := p.leadComment
    	pos := p.expect(keyword)
    	var lparen, rparen token.Pos
    	var list []ast.Spec
    	if p.tok == token.LPAREN {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 20 20:19:51 UTC 2023
    - 50.5K bytes
    - Viewed (0)
  3. src/go/parser/parser.go

    		return x.Op == token.TILDE
    	case *ast.ParenExpr:
    		return isTypeElem(x.X)
    	}
    	return false
    }
    
    func (p *parser) parseGenDecl(keyword token.Token, f parseSpecFunction) *ast.GenDecl {
    	if p.trace {
    		defer un(trace(p, "GenDecl("+keyword.String()+")"))
    	}
    
    	doc := p.leadComment
    	pos := p.expect(keyword)
    	var lparen, rparen token.Pos
    	var list []ast.Spec
    	if p.tok == token.LPAREN {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 08 20:07:50 UTC 2023
    - 72.2K bytes
    - Viewed (0)
  4. src/go/types/api_test.go

    	if err != nil {
    		t.Fatal(err)
    	}
    
    	// map import paths to importDecl
    	imports := make(map[string]*ast.ImportSpec)
    	for _, s := range f.Decls[0].(*ast.GenDecl).Specs {
    		if imp, _ := s.(*ast.ImportSpec); imp != nil {
    			imports[imp.Path.Value] = imp
    		}
    	}
    
    	for _, test := range tests {
    		imp := imports[test.path]
    		if imp == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 94.2K bytes
    - Viewed (0)
  5. src/cmd/cgo/out.go

    				r.Align = p.PtrSize
    			}
    			return r
    		}
    		// Look up the type in the top level declarations.
    		// TODO: Handle types defined within a function.
    		for _, d := range p.Decl {
    			gd, ok := d.(*ast.GenDecl)
    			if !ok || gd.Tok != token.TYPE {
    				continue
    			}
    			for _, spec := range gd.Specs {
    				ts, ok := spec.(*ast.TypeSpec)
    				if !ok {
    					continue
    				}
    				if ts.Name.Name == t.Name {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 29 16:41:10 UTC 2024
    - 59.6K bytes
    - Viewed (0)
  6. src/cmd/cgo/gcc.go

    	case *ast.FuncType, *ast.InterfaceType, *ast.MapType, *ast.ChanType:
    		return true
    	case *ast.Ident:
    		// TODO: Handle types defined within function.
    		for _, d := range p.Decl {
    			gd, ok := d.(*ast.GenDecl)
    			if !ok || gd.Tok != token.TYPE {
    				continue
    			}
    			for _, spec := range gd.Specs {
    				ts, ok := spec.(*ast.TypeSpec)
    				if !ok {
    					continue
    				}
    				if ts.Name.Name == t.Name {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 15:50:06 UTC 2024
    - 97K bytes
    - Viewed (0)
Back to top