Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(310)

Delta Between Two Patch Sets: src/pkg/go/doc/reader.go

Issue 12723043: code review 12723043: go/doc: Represent interface method declarations sam...
Left Patch Set: diff -r 50a2b541fb48 https://code.google.com/p/go Created 10 years, 7 months ago
Right Patch Set: diff -r 50a2b541fb48 https://code.google.com/p/go Created 9 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | src/pkg/go/doc/testdata/error2.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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.
bgarcia 2014/04/17 16:04:59 // resolveInterface returns...
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
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 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b