LEFT | RIGHT |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package doc | 5 package doc |
6 | 6 |
7 import ( | 7 import ( |
8 "go/ast" | 8 "go/ast" |
9 "go/token" | 9 "go/token" |
10 "regexp" | 10 "regexp" |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 mset.add(customizeRecv(m, recvTypeName, thisEmbe
ddedIsPtr, level)) | 602 mset.add(customizeRecv(m, recvTypeName, thisEmbe
ddedIsPtr, level)) |
603 } | 603 } |
604 } | 604 } |
605 if !visited[embedded] { | 605 if !visited[embedded] { |
606 r.collectEmbeddedMethods(mset, embedded, recvTypeName, t
hisEmbeddedIsPtr, level+1, visited) | 606 r.collectEmbeddedMethods(mset, embedded, recvTypeName, t
hisEmbeddedIsPtr, level+1, visited) |
607 } | 607 } |
608 } | 608 } |
609 delete(visited, typ) | 609 delete(visited, typ) |
610 } | 610 } |
611 | 611 |
612 // Returns instance and name of InterfaceType declaration if typ contains one. | 612 // resolveInterface returns instance and name of InterfaceType declaration if ty
p contains one. |
613 // | 613 // |
614 func resolveInterface(typ *namedType) (*ast.Ident, *ast.InterfaceType, bool) { | 614 func resolveInterface(typ *namedType) (*ast.Ident, *ast.InterfaceType, bool) { |
615 if typ.decl == nil || len(typ.decl.Specs) != 1 { | 615 if typ.decl == nil || len(typ.decl.Specs) != 1 { |
616 return nil, nil, false | 616 return nil, nil, false |
617 } | 617 } |
618 if spec, ok := typ.decl.Specs[0].(*ast.TypeSpec); ok { | 618 if spec, ok := typ.decl.Specs[0].(*ast.TypeSpec); ok { |
619 if iface, ok := spec.Type.(*ast.InterfaceType); ok { | 619 if iface, ok := spec.Type.(*ast.InterfaceType); ok { |
620 return spec.Name, iface, true | 620 return spec.Name, iface, true |
621 } | 621 } |
622 } | 622 } |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 "real": true, | 891 "real": true, |
892 "recover": true, | 892 "recover": true, |
893 } | 893 } |
894 | 894 |
895 var predeclaredConstants = map[string]bool{ | 895 var predeclaredConstants = map[string]bool{ |
896 "false": true, | 896 "false": true, |
897 "iota": true, | 897 "iota": true, |
898 "nil": true, | 898 "nil": true, |
899 "true": true, | 899 "true": true, |
900 } | 900 } |
LEFT | RIGHT |