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