Source file
src/go/types/iter.go
1
2
3
4
5 package types
6
7 import "iter"
8
9
10
11
12
13
14
15
16
17
18
19
20 func (t *Interface) Methods() iter.Seq[*Func] {
21 return func(yield func(m *Func) bool) {
22 for i := range t.NumMethods() {
23 if !yield(t.Method(i)) {
24 break
25 }
26 }
27 }
28 }
29
30
31
32
33
34 func (t *Interface) ExplicitMethods() iter.Seq[*Func] {
35 return func(yield func(m *Func) bool) {
36 for i := range t.NumExplicitMethods() {
37 if !yield(t.ExplicitMethod(i)) {
38 break
39 }
40 }
41 }
42 }
43
44
45
46
47 func (t *Interface) EmbeddedTypes() iter.Seq[Type] {
48 return func(yield func(e Type) bool) {
49 for i := range t.NumEmbeddeds() {
50 if !yield(t.EmbeddedType(i)) {
51 break
52 }
53 }
54 }
55 }
56
57
58
59
60 func (t *Named) Methods() iter.Seq[*Func] {
61 return func(yield func(m *Func) bool) {
62 for i := range t.NumMethods() {
63 if !yield(t.Method(i)) {
64 break
65 }
66 }
67 }
68 }
69
70
71
72
73 func (s *Scope) Children() iter.Seq[*Scope] {
74 return func(yield func(child *Scope) bool) {
75 for i := range s.NumChildren() {
76 if !yield(s.Child(i)) {
77 break
78 }
79 }
80 }
81 }
82
83
84
85
86 func (s *Struct) Fields() iter.Seq[*Var] {
87 return func(yield func(field *Var) bool) {
88 for i := range s.NumFields() {
89 if !yield(s.Field(i)) {
90 break
91 }
92 }
93 }
94 }
95
96
97
98
99 func (t *Tuple) Variables() iter.Seq[*Var] {
100 return func(yield func(v *Var) bool) {
101 for i := range t.Len() {
102 if !yield(t.At(i)) {
103 break
104 }
105 }
106 }
107 }
108
109
110
111
112 func (s *MethodSet) Methods() iter.Seq[*Selection] {
113 return func(yield func(method *Selection) bool) {
114 for i := range s.Len() {
115 if !yield(s.At(i)) {
116 break
117 }
118 }
119 }
120 }
121
122
123
124
125 func (u *Union) Terms() iter.Seq[*Term] {
126 return func(yield func(term *Term) bool) {
127 for i := range u.Len() {
128 if !yield(u.Term(i)) {
129 break
130 }
131 }
132 }
133 }
134
135
136
137
138 func (l *TypeParamList) TypeParams() iter.Seq[*TypeParam] {
139 return func(yield func(tparam *TypeParam) bool) {
140 for i := range l.Len() {
141 if !yield(l.At(i)) {
142 break
143 }
144 }
145 }
146 }
147
148
149
150
151 func (l *TypeList) Types() iter.Seq[Type] {
152 return func(yield func(t Type) bool) {
153 for i := range l.Len() {
154 if !yield(l.At(i)) {
155 break
156 }
157 }
158 }
159 }
160
View as plain text