Commit 4fa7686
committed
refactor: extract an OpenSegment helper in SplitIntoSegments
SplitIntoSegments opened a `new Segment { ... }` at five clause-boundary
sites with a near-identical four-field initializer. FromSubshell,
SubshellDepth, and SubshellStack are uniform across all five — each is a
function of the current `depth` — so a one-parameter local OpenSegment
helper collapses them; only the preceding operator varies per call site.
Behavior-preserving: the `(` branch's former `FromSubshell = true`
equals `depth > 0` because it runs after `depth++`, and the initial
segment's omitted FromSubshell equals `depth > 0` at depth 0. No public
API or parsed-AST change.1 parent 664c72a commit 4fa7686
1 file changed
Lines changed: 15 additions & 34 deletions
Lines changed: 15 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
| 634 | + | |
634 | 635 | | |
635 | | - | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
636 | 640 | | |
637 | | - | |
638 | | - | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
639 | 644 | | |
640 | 645 | | |
641 | 646 | | |
642 | | - | |
| 647 | + | |
643 | 648 | | |
644 | 649 | | |
645 | 650 | | |
| |||
658 | 663 | | |
659 | 664 | | |
660 | 665 | | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
| 666 | + | |
668 | 667 | | |
669 | 668 | | |
670 | 669 | | |
| |||
681 | 680 | | |
682 | 681 | | |
683 | 682 | | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
693 | 686 | | |
694 | 687 | | |
695 | 688 | | |
| |||
709 | 702 | | |
710 | 703 | | |
711 | 704 | | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
| 705 | + | |
719 | 706 | | |
720 | 707 | | |
721 | 708 | | |
| |||
732 | 719 | | |
733 | 720 | | |
734 | 721 | | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
| 722 | + | |
742 | 723 | | |
743 | 724 | | |
744 | 725 | | |
| |||
0 commit comments