1
2
3 package ir
4
5 import "fmt"
6
7 func (n *AddStringExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
8 func (n *AddStringExpr) copy() Node {
9 c := *n
10 c.init = copyNodes(c.init)
11 c.List = copyNodes(c.List)
12 return &c
13 }
14 func (n *AddStringExpr) doChildren(do func(Node) bool) bool {
15 if doNodes(n.init, do) {
16 return true
17 }
18 if doNodes(n.List, do) {
19 return true
20 }
21 if n.Prealloc != nil && do(n.Prealloc) {
22 return true
23 }
24 return false
25 }
26 func (n *AddStringExpr) doChildrenWithHidden(do func(Node) bool) bool {
27 return n.doChildren(do)
28 }
29 func (n *AddStringExpr) editChildren(edit func(Node) Node) {
30 editNodes(n.init, edit)
31 editNodes(n.List, edit)
32 if n.Prealloc != nil {
33 n.Prealloc = edit(n.Prealloc).(*Name)
34 }
35 }
36 func (n *AddStringExpr) editChildrenWithHidden(edit func(Node) Node) {
37 n.editChildren(edit)
38 }
39
40 func (n *AddrExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
41 func (n *AddrExpr) copy() Node {
42 c := *n
43 c.init = copyNodes(c.init)
44 return &c
45 }
46 func (n *AddrExpr) doChildren(do func(Node) bool) bool {
47 if doNodes(n.init, do) {
48 return true
49 }
50 if n.X != nil && do(n.X) {
51 return true
52 }
53 if n.Prealloc != nil && do(n.Prealloc) {
54 return true
55 }
56 return false
57 }
58 func (n *AddrExpr) doChildrenWithHidden(do func(Node) bool) bool {
59 return n.doChildren(do)
60 }
61 func (n *AddrExpr) editChildren(edit func(Node) Node) {
62 editNodes(n.init, edit)
63 if n.X != nil {
64 n.X = edit(n.X).(Node)
65 }
66 if n.Prealloc != nil {
67 n.Prealloc = edit(n.Prealloc).(*Name)
68 }
69 }
70 func (n *AddrExpr) editChildrenWithHidden(edit func(Node) Node) {
71 n.editChildren(edit)
72 }
73
74 func (n *AssignListStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
75 func (n *AssignListStmt) copy() Node {
76 c := *n
77 c.init = copyNodes(c.init)
78 c.Lhs = copyNodes(c.Lhs)
79 c.Rhs = copyNodes(c.Rhs)
80 return &c
81 }
82 func (n *AssignListStmt) doChildren(do func(Node) bool) bool {
83 if doNodes(n.init, do) {
84 return true
85 }
86 if doNodes(n.Lhs, do) {
87 return true
88 }
89 if doNodes(n.Rhs, do) {
90 return true
91 }
92 return false
93 }
94 func (n *AssignListStmt) doChildrenWithHidden(do func(Node) bool) bool {
95 return n.doChildren(do)
96 }
97 func (n *AssignListStmt) editChildren(edit func(Node) Node) {
98 editNodes(n.init, edit)
99 editNodes(n.Lhs, edit)
100 editNodes(n.Rhs, edit)
101 }
102 func (n *AssignListStmt) editChildrenWithHidden(edit func(Node) Node) {
103 n.editChildren(edit)
104 }
105
106 func (n *AssignOpStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
107 func (n *AssignOpStmt) copy() Node {
108 c := *n
109 c.init = copyNodes(c.init)
110 return &c
111 }
112 func (n *AssignOpStmt) doChildren(do func(Node) bool) bool {
113 if doNodes(n.init, do) {
114 return true
115 }
116 if n.X != nil && do(n.X) {
117 return true
118 }
119 if n.Y != nil && do(n.Y) {
120 return true
121 }
122 return false
123 }
124 func (n *AssignOpStmt) doChildrenWithHidden(do func(Node) bool) bool {
125 return n.doChildren(do)
126 }
127 func (n *AssignOpStmt) editChildren(edit func(Node) Node) {
128 editNodes(n.init, edit)
129 if n.X != nil {
130 n.X = edit(n.X).(Node)
131 }
132 if n.Y != nil {
133 n.Y = edit(n.Y).(Node)
134 }
135 }
136 func (n *AssignOpStmt) editChildrenWithHidden(edit func(Node) Node) {
137 n.editChildren(edit)
138 }
139
140 func (n *AssignStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
141 func (n *AssignStmt) copy() Node {
142 c := *n
143 c.init = copyNodes(c.init)
144 return &c
145 }
146 func (n *AssignStmt) doChildren(do func(Node) bool) bool {
147 if doNodes(n.init, do) {
148 return true
149 }
150 if n.X != nil && do(n.X) {
151 return true
152 }
153 if n.Y != nil && do(n.Y) {
154 return true
155 }
156 return false
157 }
158 func (n *AssignStmt) doChildrenWithHidden(do func(Node) bool) bool {
159 return n.doChildren(do)
160 }
161 func (n *AssignStmt) editChildren(edit func(Node) Node) {
162 editNodes(n.init, edit)
163 if n.X != nil {
164 n.X = edit(n.X).(Node)
165 }
166 if n.Y != nil {
167 n.Y = edit(n.Y).(Node)
168 }
169 }
170 func (n *AssignStmt) editChildrenWithHidden(edit func(Node) Node) {
171 n.editChildren(edit)
172 }
173
174 func (n *BasicLit) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
175 func (n *BasicLit) copy() Node {
176 c := *n
177 c.init = copyNodes(c.init)
178 return &c
179 }
180 func (n *BasicLit) doChildren(do func(Node) bool) bool {
181 if doNodes(n.init, do) {
182 return true
183 }
184 return false
185 }
186 func (n *BasicLit) doChildrenWithHidden(do func(Node) bool) bool {
187 return n.doChildren(do)
188 }
189 func (n *BasicLit) editChildren(edit func(Node) Node) {
190 editNodes(n.init, edit)
191 }
192 func (n *BasicLit) editChildrenWithHidden(edit func(Node) Node) {
193 n.editChildren(edit)
194 }
195
196 func (n *BinaryExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
197 func (n *BinaryExpr) copy() Node {
198 c := *n
199 c.init = copyNodes(c.init)
200 return &c
201 }
202 func (n *BinaryExpr) doChildren(do func(Node) bool) bool {
203 if doNodes(n.init, do) {
204 return true
205 }
206 if n.X != nil && do(n.X) {
207 return true
208 }
209 if n.Y != nil && do(n.Y) {
210 return true
211 }
212 return false
213 }
214 func (n *BinaryExpr) doChildrenWithHidden(do func(Node) bool) bool {
215 if doNodes(n.init, do) {
216 return true
217 }
218 if n.X != nil && do(n.X) {
219 return true
220 }
221 if n.Y != nil && do(n.Y) {
222 return true
223 }
224 if n.RType != nil && do(n.RType) {
225 return true
226 }
227 return false
228 }
229 func (n *BinaryExpr) editChildren(edit func(Node) Node) {
230 editNodes(n.init, edit)
231 if n.X != nil {
232 n.X = edit(n.X).(Node)
233 }
234 if n.Y != nil {
235 n.Y = edit(n.Y).(Node)
236 }
237 }
238 func (n *BinaryExpr) editChildrenWithHidden(edit func(Node) Node) {
239 editNodes(n.init, edit)
240 if n.X != nil {
241 n.X = edit(n.X).(Node)
242 }
243 if n.Y != nil {
244 n.Y = edit(n.Y).(Node)
245 }
246 if n.RType != nil {
247 n.RType = edit(n.RType).(Node)
248 }
249 }
250
251 func (n *BlockStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
252 func (n *BlockStmt) copy() Node {
253 c := *n
254 c.init = copyNodes(c.init)
255 c.List = copyNodes(c.List)
256 return &c
257 }
258 func (n *BlockStmt) doChildren(do func(Node) bool) bool {
259 if doNodes(n.init, do) {
260 return true
261 }
262 if doNodes(n.List, do) {
263 return true
264 }
265 return false
266 }
267 func (n *BlockStmt) doChildrenWithHidden(do func(Node) bool) bool {
268 return n.doChildren(do)
269 }
270 func (n *BlockStmt) editChildren(edit func(Node) Node) {
271 editNodes(n.init, edit)
272 editNodes(n.List, edit)
273 }
274 func (n *BlockStmt) editChildrenWithHidden(edit func(Node) Node) {
275 n.editChildren(edit)
276 }
277
278 func (n *BranchStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
279 func (n *BranchStmt) copy() Node {
280 c := *n
281 c.init = copyNodes(c.init)
282 return &c
283 }
284 func (n *BranchStmt) doChildren(do func(Node) bool) bool {
285 if doNodes(n.init, do) {
286 return true
287 }
288 return false
289 }
290 func (n *BranchStmt) doChildrenWithHidden(do func(Node) bool) bool {
291 return n.doChildren(do)
292 }
293 func (n *BranchStmt) editChildren(edit func(Node) Node) {
294 editNodes(n.init, edit)
295 }
296 func (n *BranchStmt) editChildrenWithHidden(edit func(Node) Node) {
297 n.editChildren(edit)
298 }
299
300 func (n *CallExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
301 func (n *CallExpr) copy() Node {
302 c := *n
303 c.init = copyNodes(c.init)
304 c.Args = copyNodes(c.Args)
305 c.KeepAlive = copyNames(c.KeepAlive)
306 return &c
307 }
308 func (n *CallExpr) doChildren(do func(Node) bool) bool {
309 if doNodes(n.init, do) {
310 return true
311 }
312 if n.Fun != nil && do(n.Fun) {
313 return true
314 }
315 if doNodes(n.Args, do) {
316 return true
317 }
318 if n.DeferAt != nil && do(n.DeferAt) {
319 return true
320 }
321 if doNames(n.KeepAlive, do) {
322 return true
323 }
324 return false
325 }
326 func (n *CallExpr) doChildrenWithHidden(do func(Node) bool) bool {
327 if doNodes(n.init, do) {
328 return true
329 }
330 if n.Fun != nil && do(n.Fun) {
331 return true
332 }
333 if doNodes(n.Args, do) {
334 return true
335 }
336 if n.DeferAt != nil && do(n.DeferAt) {
337 return true
338 }
339 if n.RType != nil && do(n.RType) {
340 return true
341 }
342 if doNames(n.KeepAlive, do) {
343 return true
344 }
345 return false
346 }
347 func (n *CallExpr) editChildren(edit func(Node) Node) {
348 editNodes(n.init, edit)
349 if n.Fun != nil {
350 n.Fun = edit(n.Fun).(Node)
351 }
352 editNodes(n.Args, edit)
353 if n.DeferAt != nil {
354 n.DeferAt = edit(n.DeferAt).(Node)
355 }
356 editNames(n.KeepAlive, edit)
357 }
358 func (n *CallExpr) editChildrenWithHidden(edit func(Node) Node) {
359 editNodes(n.init, edit)
360 if n.Fun != nil {
361 n.Fun = edit(n.Fun).(Node)
362 }
363 editNodes(n.Args, edit)
364 if n.DeferAt != nil {
365 n.DeferAt = edit(n.DeferAt).(Node)
366 }
367 if n.RType != nil {
368 n.RType = edit(n.RType).(Node)
369 }
370 editNames(n.KeepAlive, edit)
371 }
372
373 func (n *CaseClause) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
374 func (n *CaseClause) copy() Node {
375 c := *n
376 c.init = copyNodes(c.init)
377 c.List = copyNodes(c.List)
378 c.RTypes = copyNodes(c.RTypes)
379 c.Body = copyNodes(c.Body)
380 return &c
381 }
382 func (n *CaseClause) doChildren(do func(Node) bool) bool {
383 if doNodes(n.init, do) {
384 return true
385 }
386 if n.Var != nil && do(n.Var) {
387 return true
388 }
389 if doNodes(n.List, do) {
390 return true
391 }
392 if doNodes(n.RTypes, do) {
393 return true
394 }
395 if doNodes(n.Body, do) {
396 return true
397 }
398 return false
399 }
400 func (n *CaseClause) doChildrenWithHidden(do func(Node) bool) bool {
401 return n.doChildren(do)
402 }
403 func (n *CaseClause) editChildren(edit func(Node) Node) {
404 editNodes(n.init, edit)
405 if n.Var != nil {
406 n.Var = edit(n.Var).(*Name)
407 }
408 editNodes(n.List, edit)
409 editNodes(n.RTypes, edit)
410 editNodes(n.Body, edit)
411 }
412 func (n *CaseClause) editChildrenWithHidden(edit func(Node) Node) {
413 n.editChildren(edit)
414 }
415
416 func (n *ClosureExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
417 func (n *ClosureExpr) copy() Node {
418 c := *n
419 c.init = copyNodes(c.init)
420 return &c
421 }
422 func (n *ClosureExpr) doChildren(do func(Node) bool) bool {
423 if doNodes(n.init, do) {
424 return true
425 }
426 if n.Prealloc != nil && do(n.Prealloc) {
427 return true
428 }
429 return false
430 }
431 func (n *ClosureExpr) doChildrenWithHidden(do func(Node) bool) bool {
432 return n.doChildren(do)
433 }
434 func (n *ClosureExpr) editChildren(edit func(Node) Node) {
435 editNodes(n.init, edit)
436 if n.Prealloc != nil {
437 n.Prealloc = edit(n.Prealloc).(*Name)
438 }
439 }
440 func (n *ClosureExpr) editChildrenWithHidden(edit func(Node) Node) {
441 n.editChildren(edit)
442 }
443
444 func (n *CommClause) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
445 func (n *CommClause) copy() Node {
446 c := *n
447 c.init = copyNodes(c.init)
448 c.Body = copyNodes(c.Body)
449 return &c
450 }
451 func (n *CommClause) doChildren(do func(Node) bool) bool {
452 if doNodes(n.init, do) {
453 return true
454 }
455 if n.Comm != nil && do(n.Comm) {
456 return true
457 }
458 if doNodes(n.Body, do) {
459 return true
460 }
461 return false
462 }
463 func (n *CommClause) doChildrenWithHidden(do func(Node) bool) bool {
464 return n.doChildren(do)
465 }
466 func (n *CommClause) editChildren(edit func(Node) Node) {
467 editNodes(n.init, edit)
468 if n.Comm != nil {
469 n.Comm = edit(n.Comm).(Node)
470 }
471 editNodes(n.Body, edit)
472 }
473 func (n *CommClause) editChildrenWithHidden(edit func(Node) Node) {
474 n.editChildren(edit)
475 }
476
477 func (n *CompLitExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
478 func (n *CompLitExpr) copy() Node {
479 c := *n
480 c.init = copyNodes(c.init)
481 c.List = copyNodes(c.List)
482 return &c
483 }
484 func (n *CompLitExpr) doChildren(do func(Node) bool) bool {
485 if doNodes(n.init, do) {
486 return true
487 }
488 if doNodes(n.List, do) {
489 return true
490 }
491 if n.Prealloc != nil && do(n.Prealloc) {
492 return true
493 }
494 return false
495 }
496 func (n *CompLitExpr) doChildrenWithHidden(do func(Node) bool) bool {
497 if doNodes(n.init, do) {
498 return true
499 }
500 if doNodes(n.List, do) {
501 return true
502 }
503 if n.RType != nil && do(n.RType) {
504 return true
505 }
506 if n.Prealloc != nil && do(n.Prealloc) {
507 return true
508 }
509 return false
510 }
511 func (n *CompLitExpr) editChildren(edit func(Node) Node) {
512 editNodes(n.init, edit)
513 editNodes(n.List, edit)
514 if n.Prealloc != nil {
515 n.Prealloc = edit(n.Prealloc).(*Name)
516 }
517 }
518 func (n *CompLitExpr) editChildrenWithHidden(edit func(Node) Node) {
519 editNodes(n.init, edit)
520 editNodes(n.List, edit)
521 if n.RType != nil {
522 n.RType = edit(n.RType).(Node)
523 }
524 if n.Prealloc != nil {
525 n.Prealloc = edit(n.Prealloc).(*Name)
526 }
527 }
528
529 func (n *ConvExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
530 func (n *ConvExpr) copy() Node {
531 c := *n
532 c.init = copyNodes(c.init)
533 return &c
534 }
535 func (n *ConvExpr) doChildren(do func(Node) bool) bool {
536 if doNodes(n.init, do) {
537 return true
538 }
539 if n.X != nil && do(n.X) {
540 return true
541 }
542 return false
543 }
544 func (n *ConvExpr) doChildrenWithHidden(do func(Node) bool) bool {
545 if doNodes(n.init, do) {
546 return true
547 }
548 if n.X != nil && do(n.X) {
549 return true
550 }
551 if n.TypeWord != nil && do(n.TypeWord) {
552 return true
553 }
554 if n.SrcRType != nil && do(n.SrcRType) {
555 return true
556 }
557 if n.ElemRType != nil && do(n.ElemRType) {
558 return true
559 }
560 if n.ElemElemRType != nil && do(n.ElemElemRType) {
561 return true
562 }
563 return false
564 }
565 func (n *ConvExpr) editChildren(edit func(Node) Node) {
566 editNodes(n.init, edit)
567 if n.X != nil {
568 n.X = edit(n.X).(Node)
569 }
570 }
571 func (n *ConvExpr) editChildrenWithHidden(edit func(Node) Node) {
572 editNodes(n.init, edit)
573 if n.X != nil {
574 n.X = edit(n.X).(Node)
575 }
576 if n.TypeWord != nil {
577 n.TypeWord = edit(n.TypeWord).(Node)
578 }
579 if n.SrcRType != nil {
580 n.SrcRType = edit(n.SrcRType).(Node)
581 }
582 if n.ElemRType != nil {
583 n.ElemRType = edit(n.ElemRType).(Node)
584 }
585 if n.ElemElemRType != nil {
586 n.ElemElemRType = edit(n.ElemElemRType).(Node)
587 }
588 }
589
590 func (n *Decl) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
591 func (n *Decl) copy() Node {
592 c := *n
593 return &c
594 }
595 func (n *Decl) doChildren(do func(Node) bool) bool {
596 if n.X != nil && do(n.X) {
597 return true
598 }
599 return false
600 }
601 func (n *Decl) doChildrenWithHidden(do func(Node) bool) bool {
602 return n.doChildren(do)
603 }
604 func (n *Decl) editChildren(edit func(Node) Node) {
605 if n.X != nil {
606 n.X = edit(n.X).(*Name)
607 }
608 }
609 func (n *Decl) editChildrenWithHidden(edit func(Node) Node) {
610 n.editChildren(edit)
611 }
612
613 func (n *DynamicType) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
614 func (n *DynamicType) copy() Node {
615 c := *n
616 c.init = copyNodes(c.init)
617 return &c
618 }
619 func (n *DynamicType) doChildren(do func(Node) bool) bool {
620 if doNodes(n.init, do) {
621 return true
622 }
623 if n.RType != nil && do(n.RType) {
624 return true
625 }
626 if n.ITab != nil && do(n.ITab) {
627 return true
628 }
629 return false
630 }
631 func (n *DynamicType) doChildrenWithHidden(do func(Node) bool) bool {
632 return n.doChildren(do)
633 }
634 func (n *DynamicType) editChildren(edit func(Node) Node) {
635 editNodes(n.init, edit)
636 if n.RType != nil {
637 n.RType = edit(n.RType).(Node)
638 }
639 if n.ITab != nil {
640 n.ITab = edit(n.ITab).(Node)
641 }
642 }
643 func (n *DynamicType) editChildrenWithHidden(edit func(Node) Node) {
644 n.editChildren(edit)
645 }
646
647 func (n *DynamicTypeAssertExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
648 func (n *DynamicTypeAssertExpr) copy() Node {
649 c := *n
650 c.init = copyNodes(c.init)
651 return &c
652 }
653 func (n *DynamicTypeAssertExpr) doChildren(do func(Node) bool) bool {
654 if doNodes(n.init, do) {
655 return true
656 }
657 if n.X != nil && do(n.X) {
658 return true
659 }
660 if n.SrcRType != nil && do(n.SrcRType) {
661 return true
662 }
663 if n.RType != nil && do(n.RType) {
664 return true
665 }
666 if n.ITab != nil && do(n.ITab) {
667 return true
668 }
669 return false
670 }
671 func (n *DynamicTypeAssertExpr) doChildrenWithHidden(do func(Node) bool) bool {
672 return n.doChildren(do)
673 }
674 func (n *DynamicTypeAssertExpr) editChildren(edit func(Node) Node) {
675 editNodes(n.init, edit)
676 if n.X != nil {
677 n.X = edit(n.X).(Node)
678 }
679 if n.SrcRType != nil {
680 n.SrcRType = edit(n.SrcRType).(Node)
681 }
682 if n.RType != nil {
683 n.RType = edit(n.RType).(Node)
684 }
685 if n.ITab != nil {
686 n.ITab = edit(n.ITab).(Node)
687 }
688 }
689 func (n *DynamicTypeAssertExpr) editChildrenWithHidden(edit func(Node) Node) {
690 n.editChildren(edit)
691 }
692
693 func (n *ForStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
694 func (n *ForStmt) copy() Node {
695 c := *n
696 c.init = copyNodes(c.init)
697 c.Body = copyNodes(c.Body)
698 return &c
699 }
700 func (n *ForStmt) doChildren(do func(Node) bool) bool {
701 if doNodes(n.init, do) {
702 return true
703 }
704 if n.Cond != nil && do(n.Cond) {
705 return true
706 }
707 if n.Post != nil && do(n.Post) {
708 return true
709 }
710 if doNodes(n.Body, do) {
711 return true
712 }
713 return false
714 }
715 func (n *ForStmt) doChildrenWithHidden(do func(Node) bool) bool {
716 return n.doChildren(do)
717 }
718 func (n *ForStmt) editChildren(edit func(Node) Node) {
719 editNodes(n.init, edit)
720 if n.Cond != nil {
721 n.Cond = edit(n.Cond).(Node)
722 }
723 if n.Post != nil {
724 n.Post = edit(n.Post).(Node)
725 }
726 editNodes(n.Body, edit)
727 }
728 func (n *ForStmt) editChildrenWithHidden(edit func(Node) Node) {
729 n.editChildren(edit)
730 }
731
732 func (n *Func) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
733
734 func (n *GoDeferStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
735 func (n *GoDeferStmt) copy() Node {
736 c := *n
737 c.init = copyNodes(c.init)
738 return &c
739 }
740 func (n *GoDeferStmt) doChildren(do func(Node) bool) bool {
741 if doNodes(n.init, do) {
742 return true
743 }
744 if n.Call != nil && do(n.Call) {
745 return true
746 }
747 if n.DeferAt != nil && do(n.DeferAt) {
748 return true
749 }
750 return false
751 }
752 func (n *GoDeferStmt) doChildrenWithHidden(do func(Node) bool) bool {
753 return n.doChildren(do)
754 }
755 func (n *GoDeferStmt) editChildren(edit func(Node) Node) {
756 editNodes(n.init, edit)
757 if n.Call != nil {
758 n.Call = edit(n.Call).(Node)
759 }
760 if n.DeferAt != nil {
761 n.DeferAt = edit(n.DeferAt).(Expr)
762 }
763 }
764 func (n *GoDeferStmt) editChildrenWithHidden(edit func(Node) Node) {
765 n.editChildren(edit)
766 }
767
768 func (n *Ident) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
769 func (n *Ident) copy() Node {
770 c := *n
771 c.init = copyNodes(c.init)
772 return &c
773 }
774 func (n *Ident) doChildren(do func(Node) bool) bool {
775 if doNodes(n.init, do) {
776 return true
777 }
778 return false
779 }
780 func (n *Ident) doChildrenWithHidden(do func(Node) bool) bool {
781 return n.doChildren(do)
782 }
783 func (n *Ident) editChildren(edit func(Node) Node) {
784 editNodes(n.init, edit)
785 }
786 func (n *Ident) editChildrenWithHidden(edit func(Node) Node) {
787 n.editChildren(edit)
788 }
789
790 func (n *IfStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
791 func (n *IfStmt) copy() Node {
792 c := *n
793 c.init = copyNodes(c.init)
794 c.Body = copyNodes(c.Body)
795 c.Else = copyNodes(c.Else)
796 return &c
797 }
798 func (n *IfStmt) doChildren(do func(Node) bool) bool {
799 if doNodes(n.init, do) {
800 return true
801 }
802 if n.Cond != nil && do(n.Cond) {
803 return true
804 }
805 if doNodes(n.Body, do) {
806 return true
807 }
808 if doNodes(n.Else, do) {
809 return true
810 }
811 return false
812 }
813 func (n *IfStmt) doChildrenWithHidden(do func(Node) bool) bool {
814 return n.doChildren(do)
815 }
816 func (n *IfStmt) editChildren(edit func(Node) Node) {
817 editNodes(n.init, edit)
818 if n.Cond != nil {
819 n.Cond = edit(n.Cond).(Node)
820 }
821 editNodes(n.Body, edit)
822 editNodes(n.Else, edit)
823 }
824 func (n *IfStmt) editChildrenWithHidden(edit func(Node) Node) {
825 n.editChildren(edit)
826 }
827
828 func (n *IndexExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
829 func (n *IndexExpr) copy() Node {
830 c := *n
831 c.init = copyNodes(c.init)
832 return &c
833 }
834 func (n *IndexExpr) doChildren(do func(Node) bool) bool {
835 if doNodes(n.init, do) {
836 return true
837 }
838 if n.X != nil && do(n.X) {
839 return true
840 }
841 if n.Index != nil && do(n.Index) {
842 return true
843 }
844 return false
845 }
846 func (n *IndexExpr) doChildrenWithHidden(do func(Node) bool) bool {
847 if doNodes(n.init, do) {
848 return true
849 }
850 if n.X != nil && do(n.X) {
851 return true
852 }
853 if n.Index != nil && do(n.Index) {
854 return true
855 }
856 if n.RType != nil && do(n.RType) {
857 return true
858 }
859 return false
860 }
861 func (n *IndexExpr) editChildren(edit func(Node) Node) {
862 editNodes(n.init, edit)
863 if n.X != nil {
864 n.X = edit(n.X).(Node)
865 }
866 if n.Index != nil {
867 n.Index = edit(n.Index).(Node)
868 }
869 }
870 func (n *IndexExpr) editChildrenWithHidden(edit func(Node) Node) {
871 editNodes(n.init, edit)
872 if n.X != nil {
873 n.X = edit(n.X).(Node)
874 }
875 if n.Index != nil {
876 n.Index = edit(n.Index).(Node)
877 }
878 if n.RType != nil {
879 n.RType = edit(n.RType).(Node)
880 }
881 }
882
883 func (n *InlineMarkStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
884 func (n *InlineMarkStmt) copy() Node {
885 c := *n
886 c.init = copyNodes(c.init)
887 return &c
888 }
889 func (n *InlineMarkStmt) doChildren(do func(Node) bool) bool {
890 if doNodes(n.init, do) {
891 return true
892 }
893 return false
894 }
895 func (n *InlineMarkStmt) doChildrenWithHidden(do func(Node) bool) bool {
896 return n.doChildren(do)
897 }
898 func (n *InlineMarkStmt) editChildren(edit func(Node) Node) {
899 editNodes(n.init, edit)
900 }
901 func (n *InlineMarkStmt) editChildrenWithHidden(edit func(Node) Node) {
902 n.editChildren(edit)
903 }
904
905 func (n *InlinedCallExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
906 func (n *InlinedCallExpr) copy() Node {
907 c := *n
908 c.init = copyNodes(c.init)
909 c.Body = copyNodes(c.Body)
910 c.ReturnVars = copyNodes(c.ReturnVars)
911 return &c
912 }
913 func (n *InlinedCallExpr) doChildren(do func(Node) bool) bool {
914 if doNodes(n.init, do) {
915 return true
916 }
917 if doNodes(n.Body, do) {
918 return true
919 }
920 if doNodes(n.ReturnVars, do) {
921 return true
922 }
923 return false
924 }
925 func (n *InlinedCallExpr) doChildrenWithHidden(do func(Node) bool) bool {
926 return n.doChildren(do)
927 }
928 func (n *InlinedCallExpr) editChildren(edit func(Node) Node) {
929 editNodes(n.init, edit)
930 editNodes(n.Body, edit)
931 editNodes(n.ReturnVars, edit)
932 }
933 func (n *InlinedCallExpr) editChildrenWithHidden(edit func(Node) Node) {
934 n.editChildren(edit)
935 }
936
937 func (n *InterfaceSwitchStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
938 func (n *InterfaceSwitchStmt) copy() Node {
939 c := *n
940 c.init = copyNodes(c.init)
941 return &c
942 }
943 func (n *InterfaceSwitchStmt) doChildren(do func(Node) bool) bool {
944 if doNodes(n.init, do) {
945 return true
946 }
947 if n.Case != nil && do(n.Case) {
948 return true
949 }
950 if n.Itab != nil && do(n.Itab) {
951 return true
952 }
953 if n.RuntimeType != nil && do(n.RuntimeType) {
954 return true
955 }
956 if n.Hash != nil && do(n.Hash) {
957 return true
958 }
959 return false
960 }
961 func (n *InterfaceSwitchStmt) doChildrenWithHidden(do func(Node) bool) bool {
962 return n.doChildren(do)
963 }
964 func (n *InterfaceSwitchStmt) editChildren(edit func(Node) Node) {
965 editNodes(n.init, edit)
966 if n.Case != nil {
967 n.Case = edit(n.Case).(Node)
968 }
969 if n.Itab != nil {
970 n.Itab = edit(n.Itab).(Node)
971 }
972 if n.RuntimeType != nil {
973 n.RuntimeType = edit(n.RuntimeType).(Node)
974 }
975 if n.Hash != nil {
976 n.Hash = edit(n.Hash).(Node)
977 }
978 }
979 func (n *InterfaceSwitchStmt) editChildrenWithHidden(edit func(Node) Node) {
980 n.editChildren(edit)
981 }
982
983 func (n *JumpTableStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
984 func (n *JumpTableStmt) copy() Node {
985 c := *n
986 c.init = copyNodes(c.init)
987 return &c
988 }
989 func (n *JumpTableStmt) doChildren(do func(Node) bool) bool {
990 if doNodes(n.init, do) {
991 return true
992 }
993 if n.Idx != nil && do(n.Idx) {
994 return true
995 }
996 return false
997 }
998 func (n *JumpTableStmt) doChildrenWithHidden(do func(Node) bool) bool {
999 return n.doChildren(do)
1000 }
1001 func (n *JumpTableStmt) editChildren(edit func(Node) Node) {
1002 editNodes(n.init, edit)
1003 if n.Idx != nil {
1004 n.Idx = edit(n.Idx).(Node)
1005 }
1006 }
1007 func (n *JumpTableStmt) editChildrenWithHidden(edit func(Node) Node) {
1008 n.editChildren(edit)
1009 }
1010
1011 func (n *KeyExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1012 func (n *KeyExpr) copy() Node {
1013 c := *n
1014 c.init = copyNodes(c.init)
1015 return &c
1016 }
1017 func (n *KeyExpr) doChildren(do func(Node) bool) bool {
1018 if doNodes(n.init, do) {
1019 return true
1020 }
1021 if n.Key != nil && do(n.Key) {
1022 return true
1023 }
1024 if n.Value != nil && do(n.Value) {
1025 return true
1026 }
1027 return false
1028 }
1029 func (n *KeyExpr) doChildrenWithHidden(do func(Node) bool) bool {
1030 return n.doChildren(do)
1031 }
1032 func (n *KeyExpr) editChildren(edit func(Node) Node) {
1033 editNodes(n.init, edit)
1034 if n.Key != nil {
1035 n.Key = edit(n.Key).(Node)
1036 }
1037 if n.Value != nil {
1038 n.Value = edit(n.Value).(Node)
1039 }
1040 }
1041 func (n *KeyExpr) editChildrenWithHidden(edit func(Node) Node) {
1042 n.editChildren(edit)
1043 }
1044
1045 func (n *LabelStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1046 func (n *LabelStmt) copy() Node {
1047 c := *n
1048 c.init = copyNodes(c.init)
1049 return &c
1050 }
1051 func (n *LabelStmt) doChildren(do func(Node) bool) bool {
1052 if doNodes(n.init, do) {
1053 return true
1054 }
1055 return false
1056 }
1057 func (n *LabelStmt) doChildrenWithHidden(do func(Node) bool) bool {
1058 return n.doChildren(do)
1059 }
1060 func (n *LabelStmt) editChildren(edit func(Node) Node) {
1061 editNodes(n.init, edit)
1062 }
1063 func (n *LabelStmt) editChildrenWithHidden(edit func(Node) Node) {
1064 n.editChildren(edit)
1065 }
1066
1067 func (n *LinksymOffsetExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1068 func (n *LinksymOffsetExpr) copy() Node {
1069 c := *n
1070 c.init = copyNodes(c.init)
1071 return &c
1072 }
1073 func (n *LinksymOffsetExpr) doChildren(do func(Node) bool) bool {
1074 if doNodes(n.init, do) {
1075 return true
1076 }
1077 return false
1078 }
1079 func (n *LinksymOffsetExpr) doChildrenWithHidden(do func(Node) bool) bool {
1080 return n.doChildren(do)
1081 }
1082 func (n *LinksymOffsetExpr) editChildren(edit func(Node) Node) {
1083 editNodes(n.init, edit)
1084 }
1085 func (n *LinksymOffsetExpr) editChildrenWithHidden(edit func(Node) Node) {
1086 n.editChildren(edit)
1087 }
1088
1089 func (n *LogicalExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1090 func (n *LogicalExpr) copy() Node {
1091 c := *n
1092 c.init = copyNodes(c.init)
1093 return &c
1094 }
1095 func (n *LogicalExpr) doChildren(do func(Node) bool) bool {
1096 if doNodes(n.init, do) {
1097 return true
1098 }
1099 if n.X != nil && do(n.X) {
1100 return true
1101 }
1102 if n.Y != nil && do(n.Y) {
1103 return true
1104 }
1105 return false
1106 }
1107 func (n *LogicalExpr) doChildrenWithHidden(do func(Node) bool) bool {
1108 return n.doChildren(do)
1109 }
1110 func (n *LogicalExpr) editChildren(edit func(Node) Node) {
1111 editNodes(n.init, edit)
1112 if n.X != nil {
1113 n.X = edit(n.X).(Node)
1114 }
1115 if n.Y != nil {
1116 n.Y = edit(n.Y).(Node)
1117 }
1118 }
1119 func (n *LogicalExpr) editChildrenWithHidden(edit func(Node) Node) {
1120 n.editChildren(edit)
1121 }
1122
1123 func (n *MakeExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1124 func (n *MakeExpr) copy() Node {
1125 c := *n
1126 c.init = copyNodes(c.init)
1127 return &c
1128 }
1129 func (n *MakeExpr) doChildren(do func(Node) bool) bool {
1130 if doNodes(n.init, do) {
1131 return true
1132 }
1133 if n.Len != nil && do(n.Len) {
1134 return true
1135 }
1136 if n.Cap != nil && do(n.Cap) {
1137 return true
1138 }
1139 return false
1140 }
1141 func (n *MakeExpr) doChildrenWithHidden(do func(Node) bool) bool {
1142 if doNodes(n.init, do) {
1143 return true
1144 }
1145 if n.RType != nil && do(n.RType) {
1146 return true
1147 }
1148 if n.Len != nil && do(n.Len) {
1149 return true
1150 }
1151 if n.Cap != nil && do(n.Cap) {
1152 return true
1153 }
1154 return false
1155 }
1156 func (n *MakeExpr) editChildren(edit func(Node) Node) {
1157 editNodes(n.init, edit)
1158 if n.Len != nil {
1159 n.Len = edit(n.Len).(Node)
1160 }
1161 if n.Cap != nil {
1162 n.Cap = edit(n.Cap).(Node)
1163 }
1164 }
1165 func (n *MakeExpr) editChildrenWithHidden(edit func(Node) Node) {
1166 editNodes(n.init, edit)
1167 if n.RType != nil {
1168 n.RType = edit(n.RType).(Node)
1169 }
1170 if n.Len != nil {
1171 n.Len = edit(n.Len).(Node)
1172 }
1173 if n.Cap != nil {
1174 n.Cap = edit(n.Cap).(Node)
1175 }
1176 }
1177
1178 func (n *MoveToHeapExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1179 func (n *MoveToHeapExpr) copy() Node {
1180 c := *n
1181 c.init = copyNodes(c.init)
1182 return &c
1183 }
1184 func (n *MoveToHeapExpr) doChildren(do func(Node) bool) bool {
1185 if doNodes(n.init, do) {
1186 return true
1187 }
1188 if n.Slice != nil && do(n.Slice) {
1189 return true
1190 }
1191 if n.RType != nil && do(n.RType) {
1192 return true
1193 }
1194 return false
1195 }
1196 func (n *MoveToHeapExpr) doChildrenWithHidden(do func(Node) bool) bool {
1197 return n.doChildren(do)
1198 }
1199 func (n *MoveToHeapExpr) editChildren(edit func(Node) Node) {
1200 editNodes(n.init, edit)
1201 if n.Slice != nil {
1202 n.Slice = edit(n.Slice).(Node)
1203 }
1204 if n.RType != nil {
1205 n.RType = edit(n.RType).(Node)
1206 }
1207 }
1208 func (n *MoveToHeapExpr) editChildrenWithHidden(edit func(Node) Node) {
1209 n.editChildren(edit)
1210 }
1211
1212 func (n *Name) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1213
1214 func (n *NilExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1215 func (n *NilExpr) copy() Node {
1216 c := *n
1217 c.init = copyNodes(c.init)
1218 return &c
1219 }
1220 func (n *NilExpr) doChildren(do func(Node) bool) bool {
1221 if doNodes(n.init, do) {
1222 return true
1223 }
1224 return false
1225 }
1226 func (n *NilExpr) doChildrenWithHidden(do func(Node) bool) bool {
1227 return n.doChildren(do)
1228 }
1229 func (n *NilExpr) editChildren(edit func(Node) Node) {
1230 editNodes(n.init, edit)
1231 }
1232 func (n *NilExpr) editChildrenWithHidden(edit func(Node) Node) {
1233 n.editChildren(edit)
1234 }
1235
1236 func (n *ParenExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1237 func (n *ParenExpr) copy() Node {
1238 c := *n
1239 c.init = copyNodes(c.init)
1240 return &c
1241 }
1242 func (n *ParenExpr) doChildren(do func(Node) bool) bool {
1243 if doNodes(n.init, do) {
1244 return true
1245 }
1246 if n.X != nil && do(n.X) {
1247 return true
1248 }
1249 return false
1250 }
1251 func (n *ParenExpr) doChildrenWithHidden(do func(Node) bool) bool {
1252 return n.doChildren(do)
1253 }
1254 func (n *ParenExpr) editChildren(edit func(Node) Node) {
1255 editNodes(n.init, edit)
1256 if n.X != nil {
1257 n.X = edit(n.X).(Node)
1258 }
1259 }
1260 func (n *ParenExpr) editChildrenWithHidden(edit func(Node) Node) {
1261 n.editChildren(edit)
1262 }
1263
1264 func (n *RangeStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1265 func (n *RangeStmt) copy() Node {
1266 c := *n
1267 c.init = copyNodes(c.init)
1268 c.Body = copyNodes(c.Body)
1269 return &c
1270 }
1271 func (n *RangeStmt) doChildren(do func(Node) bool) bool {
1272 if doNodes(n.init, do) {
1273 return true
1274 }
1275 if n.X != nil && do(n.X) {
1276 return true
1277 }
1278 if n.Key != nil && do(n.Key) {
1279 return true
1280 }
1281 if n.Value != nil && do(n.Value) {
1282 return true
1283 }
1284 if doNodes(n.Body, do) {
1285 return true
1286 }
1287 if n.Prealloc != nil && do(n.Prealloc) {
1288 return true
1289 }
1290 return false
1291 }
1292 func (n *RangeStmt) doChildrenWithHidden(do func(Node) bool) bool {
1293 if doNodes(n.init, do) {
1294 return true
1295 }
1296 if n.X != nil && do(n.X) {
1297 return true
1298 }
1299 if n.RType != nil && do(n.RType) {
1300 return true
1301 }
1302 if n.Key != nil && do(n.Key) {
1303 return true
1304 }
1305 if n.Value != nil && do(n.Value) {
1306 return true
1307 }
1308 if doNodes(n.Body, do) {
1309 return true
1310 }
1311 if n.Prealloc != nil && do(n.Prealloc) {
1312 return true
1313 }
1314 if n.KeyTypeWord != nil && do(n.KeyTypeWord) {
1315 return true
1316 }
1317 if n.KeySrcRType != nil && do(n.KeySrcRType) {
1318 return true
1319 }
1320 if n.ValueTypeWord != nil && do(n.ValueTypeWord) {
1321 return true
1322 }
1323 if n.ValueSrcRType != nil && do(n.ValueSrcRType) {
1324 return true
1325 }
1326 return false
1327 }
1328 func (n *RangeStmt) editChildren(edit func(Node) Node) {
1329 editNodes(n.init, edit)
1330 if n.X != nil {
1331 n.X = edit(n.X).(Node)
1332 }
1333 if n.Key != nil {
1334 n.Key = edit(n.Key).(Node)
1335 }
1336 if n.Value != nil {
1337 n.Value = edit(n.Value).(Node)
1338 }
1339 editNodes(n.Body, edit)
1340 if n.Prealloc != nil {
1341 n.Prealloc = edit(n.Prealloc).(*Name)
1342 }
1343 }
1344 func (n *RangeStmt) editChildrenWithHidden(edit func(Node) Node) {
1345 editNodes(n.init, edit)
1346 if n.X != nil {
1347 n.X = edit(n.X).(Node)
1348 }
1349 if n.RType != nil {
1350 n.RType = edit(n.RType).(Node)
1351 }
1352 if n.Key != nil {
1353 n.Key = edit(n.Key).(Node)
1354 }
1355 if n.Value != nil {
1356 n.Value = edit(n.Value).(Node)
1357 }
1358 editNodes(n.Body, edit)
1359 if n.Prealloc != nil {
1360 n.Prealloc = edit(n.Prealloc).(*Name)
1361 }
1362 if n.KeyTypeWord != nil {
1363 n.KeyTypeWord = edit(n.KeyTypeWord).(Node)
1364 }
1365 if n.KeySrcRType != nil {
1366 n.KeySrcRType = edit(n.KeySrcRType).(Node)
1367 }
1368 if n.ValueTypeWord != nil {
1369 n.ValueTypeWord = edit(n.ValueTypeWord).(Node)
1370 }
1371 if n.ValueSrcRType != nil {
1372 n.ValueSrcRType = edit(n.ValueSrcRType).(Node)
1373 }
1374 }
1375
1376 func (n *ResultExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1377 func (n *ResultExpr) copy() Node {
1378 c := *n
1379 c.init = copyNodes(c.init)
1380 return &c
1381 }
1382 func (n *ResultExpr) doChildren(do func(Node) bool) bool {
1383 if doNodes(n.init, do) {
1384 return true
1385 }
1386 return false
1387 }
1388 func (n *ResultExpr) doChildrenWithHidden(do func(Node) bool) bool {
1389 return n.doChildren(do)
1390 }
1391 func (n *ResultExpr) editChildren(edit func(Node) Node) {
1392 editNodes(n.init, edit)
1393 }
1394 func (n *ResultExpr) editChildrenWithHidden(edit func(Node) Node) {
1395 n.editChildren(edit)
1396 }
1397
1398 func (n *ReturnStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1399 func (n *ReturnStmt) copy() Node {
1400 c := *n
1401 c.init = copyNodes(c.init)
1402 c.Results = copyNodes(c.Results)
1403 return &c
1404 }
1405 func (n *ReturnStmt) doChildren(do func(Node) bool) bool {
1406 if doNodes(n.init, do) {
1407 return true
1408 }
1409 if doNodes(n.Results, do) {
1410 return true
1411 }
1412 return false
1413 }
1414 func (n *ReturnStmt) doChildrenWithHidden(do func(Node) bool) bool {
1415 return n.doChildren(do)
1416 }
1417 func (n *ReturnStmt) editChildren(edit func(Node) Node) {
1418 editNodes(n.init, edit)
1419 editNodes(n.Results, edit)
1420 }
1421 func (n *ReturnStmt) editChildrenWithHidden(edit func(Node) Node) {
1422 n.editChildren(edit)
1423 }
1424
1425 func (n *SelectStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1426 func (n *SelectStmt) copy() Node {
1427 c := *n
1428 c.init = copyNodes(c.init)
1429 c.Cases = copyCommClauses(c.Cases)
1430 c.Compiled = copyNodes(c.Compiled)
1431 return &c
1432 }
1433 func (n *SelectStmt) doChildren(do func(Node) bool) bool {
1434 if doNodes(n.init, do) {
1435 return true
1436 }
1437 if doCommClauses(n.Cases, do) {
1438 return true
1439 }
1440 if doNodes(n.Compiled, do) {
1441 return true
1442 }
1443 return false
1444 }
1445 func (n *SelectStmt) doChildrenWithHidden(do func(Node) bool) bool {
1446 return n.doChildren(do)
1447 }
1448 func (n *SelectStmt) editChildren(edit func(Node) Node) {
1449 editNodes(n.init, edit)
1450 editCommClauses(n.Cases, edit)
1451 editNodes(n.Compiled, edit)
1452 }
1453 func (n *SelectStmt) editChildrenWithHidden(edit func(Node) Node) {
1454 n.editChildren(edit)
1455 }
1456
1457 func (n *SelectorExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1458 func (n *SelectorExpr) copy() Node {
1459 c := *n
1460 c.init = copyNodes(c.init)
1461 return &c
1462 }
1463 func (n *SelectorExpr) doChildren(do func(Node) bool) bool {
1464 if doNodes(n.init, do) {
1465 return true
1466 }
1467 if n.X != nil && do(n.X) {
1468 return true
1469 }
1470 if n.Prealloc != nil && do(n.Prealloc) {
1471 return true
1472 }
1473 return false
1474 }
1475 func (n *SelectorExpr) doChildrenWithHidden(do func(Node) bool) bool {
1476 return n.doChildren(do)
1477 }
1478 func (n *SelectorExpr) editChildren(edit func(Node) Node) {
1479 editNodes(n.init, edit)
1480 if n.X != nil {
1481 n.X = edit(n.X).(Node)
1482 }
1483 if n.Prealloc != nil {
1484 n.Prealloc = edit(n.Prealloc).(*Name)
1485 }
1486 }
1487 func (n *SelectorExpr) editChildrenWithHidden(edit func(Node) Node) {
1488 n.editChildren(edit)
1489 }
1490
1491 func (n *SendStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1492 func (n *SendStmt) copy() Node {
1493 c := *n
1494 c.init = copyNodes(c.init)
1495 return &c
1496 }
1497 func (n *SendStmt) doChildren(do func(Node) bool) bool {
1498 if doNodes(n.init, do) {
1499 return true
1500 }
1501 if n.Chan != nil && do(n.Chan) {
1502 return true
1503 }
1504 if n.Value != nil && do(n.Value) {
1505 return true
1506 }
1507 return false
1508 }
1509 func (n *SendStmt) doChildrenWithHidden(do func(Node) bool) bool {
1510 return n.doChildren(do)
1511 }
1512 func (n *SendStmt) editChildren(edit func(Node) Node) {
1513 editNodes(n.init, edit)
1514 if n.Chan != nil {
1515 n.Chan = edit(n.Chan).(Node)
1516 }
1517 if n.Value != nil {
1518 n.Value = edit(n.Value).(Node)
1519 }
1520 }
1521 func (n *SendStmt) editChildrenWithHidden(edit func(Node) Node) {
1522 n.editChildren(edit)
1523 }
1524
1525 func (n *SliceExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1526 func (n *SliceExpr) copy() Node {
1527 c := *n
1528 c.init = copyNodes(c.init)
1529 return &c
1530 }
1531 func (n *SliceExpr) doChildren(do func(Node) bool) bool {
1532 if doNodes(n.init, do) {
1533 return true
1534 }
1535 if n.X != nil && do(n.X) {
1536 return true
1537 }
1538 if n.Low != nil && do(n.Low) {
1539 return true
1540 }
1541 if n.High != nil && do(n.High) {
1542 return true
1543 }
1544 if n.Max != nil && do(n.Max) {
1545 return true
1546 }
1547 return false
1548 }
1549 func (n *SliceExpr) doChildrenWithHidden(do func(Node) bool) bool {
1550 return n.doChildren(do)
1551 }
1552 func (n *SliceExpr) editChildren(edit func(Node) Node) {
1553 editNodes(n.init, edit)
1554 if n.X != nil {
1555 n.X = edit(n.X).(Node)
1556 }
1557 if n.Low != nil {
1558 n.Low = edit(n.Low).(Node)
1559 }
1560 if n.High != nil {
1561 n.High = edit(n.High).(Node)
1562 }
1563 if n.Max != nil {
1564 n.Max = edit(n.Max).(Node)
1565 }
1566 }
1567 func (n *SliceExpr) editChildrenWithHidden(edit func(Node) Node) {
1568 n.editChildren(edit)
1569 }
1570
1571 func (n *SliceHeaderExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1572 func (n *SliceHeaderExpr) copy() Node {
1573 c := *n
1574 c.init = copyNodes(c.init)
1575 return &c
1576 }
1577 func (n *SliceHeaderExpr) doChildren(do func(Node) bool) bool {
1578 if doNodes(n.init, do) {
1579 return true
1580 }
1581 if n.Ptr != nil && do(n.Ptr) {
1582 return true
1583 }
1584 if n.Len != nil && do(n.Len) {
1585 return true
1586 }
1587 if n.Cap != nil && do(n.Cap) {
1588 return true
1589 }
1590 return false
1591 }
1592 func (n *SliceHeaderExpr) doChildrenWithHidden(do func(Node) bool) bool {
1593 return n.doChildren(do)
1594 }
1595 func (n *SliceHeaderExpr) editChildren(edit func(Node) Node) {
1596 editNodes(n.init, edit)
1597 if n.Ptr != nil {
1598 n.Ptr = edit(n.Ptr).(Node)
1599 }
1600 if n.Len != nil {
1601 n.Len = edit(n.Len).(Node)
1602 }
1603 if n.Cap != nil {
1604 n.Cap = edit(n.Cap).(Node)
1605 }
1606 }
1607 func (n *SliceHeaderExpr) editChildrenWithHidden(edit func(Node) Node) {
1608 n.editChildren(edit)
1609 }
1610
1611 func (n *StarExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1612 func (n *StarExpr) copy() Node {
1613 c := *n
1614 c.init = copyNodes(c.init)
1615 return &c
1616 }
1617 func (n *StarExpr) doChildren(do func(Node) bool) bool {
1618 if doNodes(n.init, do) {
1619 return true
1620 }
1621 if n.X != nil && do(n.X) {
1622 return true
1623 }
1624 return false
1625 }
1626 func (n *StarExpr) doChildrenWithHidden(do func(Node) bool) bool {
1627 return n.doChildren(do)
1628 }
1629 func (n *StarExpr) editChildren(edit func(Node) Node) {
1630 editNodes(n.init, edit)
1631 if n.X != nil {
1632 n.X = edit(n.X).(Node)
1633 }
1634 }
1635 func (n *StarExpr) editChildrenWithHidden(edit func(Node) Node) {
1636 n.editChildren(edit)
1637 }
1638
1639 func (n *StringHeaderExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1640 func (n *StringHeaderExpr) copy() Node {
1641 c := *n
1642 c.init = copyNodes(c.init)
1643 return &c
1644 }
1645 func (n *StringHeaderExpr) doChildren(do func(Node) bool) bool {
1646 if doNodes(n.init, do) {
1647 return true
1648 }
1649 if n.Ptr != nil && do(n.Ptr) {
1650 return true
1651 }
1652 if n.Len != nil && do(n.Len) {
1653 return true
1654 }
1655 return false
1656 }
1657 func (n *StringHeaderExpr) doChildrenWithHidden(do func(Node) bool) bool {
1658 return n.doChildren(do)
1659 }
1660 func (n *StringHeaderExpr) editChildren(edit func(Node) Node) {
1661 editNodes(n.init, edit)
1662 if n.Ptr != nil {
1663 n.Ptr = edit(n.Ptr).(Node)
1664 }
1665 if n.Len != nil {
1666 n.Len = edit(n.Len).(Node)
1667 }
1668 }
1669 func (n *StringHeaderExpr) editChildrenWithHidden(edit func(Node) Node) {
1670 n.editChildren(edit)
1671 }
1672
1673 func (n *StructKeyExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1674 func (n *StructKeyExpr) copy() Node {
1675 c := *n
1676 c.init = copyNodes(c.init)
1677 return &c
1678 }
1679 func (n *StructKeyExpr) doChildren(do func(Node) bool) bool {
1680 if doNodes(n.init, do) {
1681 return true
1682 }
1683 if n.Value != nil && do(n.Value) {
1684 return true
1685 }
1686 return false
1687 }
1688 func (n *StructKeyExpr) doChildrenWithHidden(do func(Node) bool) bool {
1689 return n.doChildren(do)
1690 }
1691 func (n *StructKeyExpr) editChildren(edit func(Node) Node) {
1692 editNodes(n.init, edit)
1693 if n.Value != nil {
1694 n.Value = edit(n.Value).(Node)
1695 }
1696 }
1697 func (n *StructKeyExpr) editChildrenWithHidden(edit func(Node) Node) {
1698 n.editChildren(edit)
1699 }
1700
1701 func (n *SwitchStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1702 func (n *SwitchStmt) copy() Node {
1703 c := *n
1704 c.init = copyNodes(c.init)
1705 c.Cases = copyCaseClauses(c.Cases)
1706 c.Compiled = copyNodes(c.Compiled)
1707 return &c
1708 }
1709 func (n *SwitchStmt) doChildren(do func(Node) bool) bool {
1710 if doNodes(n.init, do) {
1711 return true
1712 }
1713 if n.Tag != nil && do(n.Tag) {
1714 return true
1715 }
1716 if doCaseClauses(n.Cases, do) {
1717 return true
1718 }
1719 if doNodes(n.Compiled, do) {
1720 return true
1721 }
1722 return false
1723 }
1724 func (n *SwitchStmt) doChildrenWithHidden(do func(Node) bool) bool {
1725 return n.doChildren(do)
1726 }
1727 func (n *SwitchStmt) editChildren(edit func(Node) Node) {
1728 editNodes(n.init, edit)
1729 if n.Tag != nil {
1730 n.Tag = edit(n.Tag).(Node)
1731 }
1732 editCaseClauses(n.Cases, edit)
1733 editNodes(n.Compiled, edit)
1734 }
1735 func (n *SwitchStmt) editChildrenWithHidden(edit func(Node) Node) {
1736 n.editChildren(edit)
1737 }
1738
1739 func (n *TailCallStmt) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1740 func (n *TailCallStmt) copy() Node {
1741 c := *n
1742 c.init = copyNodes(c.init)
1743 return &c
1744 }
1745 func (n *TailCallStmt) doChildren(do func(Node) bool) bool {
1746 if doNodes(n.init, do) {
1747 return true
1748 }
1749 if n.Call != nil && do(n.Call) {
1750 return true
1751 }
1752 return false
1753 }
1754 func (n *TailCallStmt) doChildrenWithHidden(do func(Node) bool) bool {
1755 return n.doChildren(do)
1756 }
1757 func (n *TailCallStmt) editChildren(edit func(Node) Node) {
1758 editNodes(n.init, edit)
1759 if n.Call != nil {
1760 n.Call = edit(n.Call).(*CallExpr)
1761 }
1762 }
1763 func (n *TailCallStmt) editChildrenWithHidden(edit func(Node) Node) {
1764 n.editChildren(edit)
1765 }
1766
1767 func (n *TypeAssertExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1768 func (n *TypeAssertExpr) copy() Node {
1769 c := *n
1770 c.init = copyNodes(c.init)
1771 return &c
1772 }
1773 func (n *TypeAssertExpr) doChildren(do func(Node) bool) bool {
1774 if doNodes(n.init, do) {
1775 return true
1776 }
1777 if n.X != nil && do(n.X) {
1778 return true
1779 }
1780 return false
1781 }
1782 func (n *TypeAssertExpr) doChildrenWithHidden(do func(Node) bool) bool {
1783 if doNodes(n.init, do) {
1784 return true
1785 }
1786 if n.X != nil && do(n.X) {
1787 return true
1788 }
1789 if n.ITab != nil && do(n.ITab) {
1790 return true
1791 }
1792 return false
1793 }
1794 func (n *TypeAssertExpr) editChildren(edit func(Node) Node) {
1795 editNodes(n.init, edit)
1796 if n.X != nil {
1797 n.X = edit(n.X).(Node)
1798 }
1799 }
1800 func (n *TypeAssertExpr) editChildrenWithHidden(edit func(Node) Node) {
1801 editNodes(n.init, edit)
1802 if n.X != nil {
1803 n.X = edit(n.X).(Node)
1804 }
1805 if n.ITab != nil {
1806 n.ITab = edit(n.ITab).(Node)
1807 }
1808 }
1809
1810 func (n *TypeSwitchGuard) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1811 func (n *TypeSwitchGuard) copy() Node {
1812 c := *n
1813 return &c
1814 }
1815 func (n *TypeSwitchGuard) doChildren(do func(Node) bool) bool {
1816 if n.Tag != nil && do(n.Tag) {
1817 return true
1818 }
1819 if n.X != nil && do(n.X) {
1820 return true
1821 }
1822 return false
1823 }
1824 func (n *TypeSwitchGuard) doChildrenWithHidden(do func(Node) bool) bool {
1825 return n.doChildren(do)
1826 }
1827 func (n *TypeSwitchGuard) editChildren(edit func(Node) Node) {
1828 if n.Tag != nil {
1829 n.Tag = edit(n.Tag).(*Ident)
1830 }
1831 if n.X != nil {
1832 n.X = edit(n.X).(Node)
1833 }
1834 }
1835 func (n *TypeSwitchGuard) editChildrenWithHidden(edit func(Node) Node) {
1836 n.editChildren(edit)
1837 }
1838
1839 func (n *UnaryExpr) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1840 func (n *UnaryExpr) copy() Node {
1841 c := *n
1842 c.init = copyNodes(c.init)
1843 return &c
1844 }
1845 func (n *UnaryExpr) doChildren(do func(Node) bool) bool {
1846 if doNodes(n.init, do) {
1847 return true
1848 }
1849 if n.X != nil && do(n.X) {
1850 return true
1851 }
1852 return false
1853 }
1854 func (n *UnaryExpr) doChildrenWithHidden(do func(Node) bool) bool {
1855 return n.doChildren(do)
1856 }
1857 func (n *UnaryExpr) editChildren(edit func(Node) Node) {
1858 editNodes(n.init, edit)
1859 if n.X != nil {
1860 n.X = edit(n.X).(Node)
1861 }
1862 }
1863 func (n *UnaryExpr) editChildrenWithHidden(edit func(Node) Node) {
1864 n.editChildren(edit)
1865 }
1866
1867 func (n *typeNode) Format(s fmt.State, verb rune) { fmtNode(n, s, verb) }
1868 func (n *typeNode) copy() Node {
1869 c := *n
1870 return &c
1871 }
1872 func (n *typeNode) doChildren(do func(Node) bool) bool {
1873 return false
1874 }
1875 func (n *typeNode) doChildrenWithHidden(do func(Node) bool) bool {
1876 return n.doChildren(do)
1877 }
1878 func (n *typeNode) editChildren(edit func(Node) Node) {
1879 }
1880 func (n *typeNode) editChildrenWithHidden(edit func(Node) Node) {
1881 n.editChildren(edit)
1882 }
1883
1884 func copyCaseClauses(list []*CaseClause) []*CaseClause {
1885 if list == nil {
1886 return nil
1887 }
1888 c := make([]*CaseClause, len(list))
1889 copy(c, list)
1890 return c
1891 }
1892 func doCaseClauses(list []*CaseClause, do func(Node) bool) bool {
1893 for _, x := range list {
1894 if x != nil && do(x) {
1895 return true
1896 }
1897 }
1898 return false
1899 }
1900 func editCaseClauses(list []*CaseClause, edit func(Node) Node) {
1901 for i, x := range list {
1902 if x != nil {
1903 list[i] = edit(x).(*CaseClause)
1904 }
1905 }
1906 }
1907
1908 func copyCommClauses(list []*CommClause) []*CommClause {
1909 if list == nil {
1910 return nil
1911 }
1912 c := make([]*CommClause, len(list))
1913 copy(c, list)
1914 return c
1915 }
1916 func doCommClauses(list []*CommClause, do func(Node) bool) bool {
1917 for _, x := range list {
1918 if x != nil && do(x) {
1919 return true
1920 }
1921 }
1922 return false
1923 }
1924 func editCommClauses(list []*CommClause, edit func(Node) Node) {
1925 for i, x := range list {
1926 if x != nil {
1927 list[i] = edit(x).(*CommClause)
1928 }
1929 }
1930 }
1931
1932 func copyNames(list []*Name) []*Name {
1933 if list == nil {
1934 return nil
1935 }
1936 c := make([]*Name, len(list))
1937 copy(c, list)
1938 return c
1939 }
1940 func doNames(list []*Name, do func(Node) bool) bool {
1941 for _, x := range list {
1942 if x != nil && do(x) {
1943 return true
1944 }
1945 }
1946 return false
1947 }
1948 func editNames(list []*Name, edit func(Node) Node) {
1949 for i, x := range list {
1950 if x != nil {
1951 list[i] = edit(x).(*Name)
1952 }
1953 }
1954 }
1955
1956 func copyNodes(list []Node) []Node {
1957 if list == nil {
1958 return nil
1959 }
1960 c := make([]Node, len(list))
1961 copy(c, list)
1962 return c
1963 }
1964 func doNodes(list []Node, do func(Node) bool) bool {
1965 for _, x := range list {
1966 if x != nil && do(x) {
1967 return true
1968 }
1969 }
1970 return false
1971 }
1972 func editNodes(list []Node, edit func(Node) Node) {
1973 for i, x := range list {
1974 if x != nil {
1975 list[i] = edit(x).(Node)
1976 }
1977 }
1978 }
1979
View as plain text