6 if (($Config::Config{'extensions'} !~ /\bB\b/) ){
7 print "1..0 # Skip -- Perl configured without B module\n";
10 if (!$Config::Config{useperlio}) {
11 print "1..0 # Skip -- need perlio to walk the optree\n";
20 Code test snippets here are adapted from `perldoc -f map`
22 Due to a bleadperl optimization (Dave Mitchell, circa apr 04), the
23 (map|grep)(start|while) opcodes have different flags in 5.9, their
24 private flags /1, /2 are gone in blead (for the cases covered)
26 When the optree stuff was integrated into 5.8.6, these tests failed,
27 and were todo'd. They're now done, by version-specific tweaking in
28 mkCheckRex(), therefore the skip is removed too.
33 #examples poached from perldoc -f sort
35 NOTE: name is no longer a required arg for checkOptree, as label is
36 synthesized out of others. HOWEVER, if the test-code has newlines in
37 it, the label must be overridden by an explicit name.
39 This is because t/TEST is quite particular about the test output it
40 processes, and multi-line labels violate its 1-line-per-test
45 # chunk: # sort lexically
46 @articles = sort @files;
50 checkOptree(note => q{},
52 code => q{@articles = sort @files; },
53 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
54 # 1 <;> nextstate(main 545 (eval 15):1) v
58 # 5 <1> rv2av[t4] lK/1
61 # 8 <#> gv[*articles] s
62 # 9 <1> rv2av[t2] lKRM*/1
63 # a <2> aassign[t5] KS/COMMON
64 # b <1> leavesub[1 ref] K/REFC,1
66 # 1 <;> nextstate(main 545 (eval 15):1) v
70 # 5 <1> rv2av[t2] lK/1
73 # 8 <$> gv(*articles) s
74 # 9 <1> rv2av[t1] lKRM*/1
75 # a <2> aassign[t3] KS/COMMON
76 # b <1> leavesub[1 ref] K/REFC,1
82 # chunk: # same thing, but with explicit sort routine
83 @articles = sort {$a cmp $b} @files;
87 checkOptree(note => q{},
89 code => q{@articles = sort {$a cmp $b} @files; },
90 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
91 # 1 <;> nextstate(main 546 (eval 15):1) v
95 # 5 <1> rv2av[t7] lK/1
98 # 8 <#> gv[*articles] s
99 # 9 <1> rv2av[t2] lKRM*/1
100 # a <2> aassign[t3] KS/COMMON
101 # b <1> leavesub[1 ref] K/REFC,1
103 # 1 <;> nextstate(main 546 (eval 15):1) v
107 # 5 <1> rv2av[t3] lK/1
110 # 8 <$> gv(*articles) s
111 # 9 <1> rv2av[t1] lKRM*/1
112 # a <2> aassign[t2] KS/COMMON
113 # b <1> leavesub[1 ref] K/REFC,1
119 # chunk: # now case-insensitively
120 @articles = sort {uc($a) cmp uc($b)} @files;
124 checkOptree(note => q{},
126 code => q{@articles = sort {uc($a) cmp uc($b)} @files; },
127 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
128 # 1 <;> nextstate(main 546 (eval 15):1) v
132 # 5 <1> rv2av[t9] lK/1
135 # 8 <#> gv[*articles] s
136 # 9 <1> rv2av[t2] lKRM*/1
137 # a <2> aassign[t10] KS/COMMON
138 # b <1> leavesub[1 ref] K/REFC,1
140 # 1 <;> nextstate(main 546 (eval 15):1) v
144 # 5 <1> rv2av[t5] lK/1
147 # 8 <$> gv(*articles) s
148 # 9 <1> rv2av[t1] lKRM*/1
149 # a <2> aassign[t6] KS/COMMON
150 # b <1> leavesub[1 ref] K/REFC,1
156 # chunk: # same thing in reversed order
157 @articles = sort {$b cmp $a} @files;
161 checkOptree(note => q{},
163 code => q{@articles = sort {$b cmp $a} @files; },
164 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
165 # 1 <;> nextstate(main 546 (eval 15):1) v
169 # 5 <1> rv2av[t7] lK/1
172 # 8 <#> gv[*articles] s
173 # 9 <1> rv2av[t2] lKRM*/1
174 # a <2> aassign[t3] KS/COMMON
175 # b <1> leavesub[1 ref] K/REFC,1
177 # 1 <;> nextstate(main 546 (eval 15):1) v
181 # 5 <1> rv2av[t3] lK/1
184 # 8 <$> gv(*articles) s
185 # 9 <1> rv2av[t1] lKRM*/1
186 # a <2> aassign[t2] KS/COMMON
187 # b <1> leavesub[1 ref] K/REFC,1
193 # chunk: # sort numerically ascending
194 @articles = sort {$a <=> $b} @files;
198 checkOptree(note => q{},
200 code => q{@articles = sort {$a <=> $b} @files; },
201 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
202 # 1 <;> nextstate(main 546 (eval 15):1) v
206 # 5 <1> rv2av[t7] lK/1
209 # 8 <#> gv[*articles] s
210 # 9 <1> rv2av[t2] lKRM*/1
211 # a <2> aassign[t3] KS/COMMON
212 # b <1> leavesub[1 ref] K/REFC,1
214 # 1 <;> nextstate(main 546 (eval 15):1) v
218 # 5 <1> rv2av[t3] lK/1
221 # 8 <$> gv(*articles) s
222 # 9 <1> rv2av[t1] lKRM*/1
223 # a <2> aassign[t2] KS/COMMON
224 # b <1> leavesub[1 ref] K/REFC,1
230 # chunk: # sort numerically descending
231 @articles = sort {$b <=> $a} @files;
235 checkOptree(note => q{},
237 code => q{@articles = sort {$b <=> $a} @files; },
238 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
239 # 1 <;> nextstate(main 587 (eval 26):1) v
243 # 5 <1> rv2av[t7] lK/1
244 # 6 <@> sort lK/DESC,NUM
246 # 8 <#> gv[*articles] s
247 # 9 <1> rv2av[t2] lKRM*/1
248 # a <2> aassign[t3] KS/COMMON
249 # b <1> leavesub[1 ref] K/REFC,1
251 # 1 <;> nextstate(main 546 (eval 15):1) v
255 # 5 <1> rv2av[t3] lK/1
256 # 6 <@> sort lK/DESC,NUM
258 # 8 <$> gv(*articles) s
259 # 9 <1> rv2av[t1] lKRM*/1
260 # a <2> aassign[t2] KS/COMMON
261 # b <1> leavesub[1 ref] K/REFC,1
267 # chunk: # this sorts the %age hash by value instead of key
268 # using an in-line function
269 @eldest = sort { $age{$b} <=> $age{$a} } keys %age;
273 checkOptree(note => q{},
275 code => q{@eldest = sort { $age{$b} <=> $age{$a} } keys %age; },
276 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
277 # 1 <;> nextstate(main 592 (eval 28):1) v
281 # 5 <1> rv2hv[t9] lKRM/1
282 # 6 <1> keys[t10] lK/1
285 # 9 <#> gv[*eldest] s
286 # a <1> rv2av[t2] lKRM*/1
287 # b <2> aassign[t11] KS/COMMON
288 # c <1> leavesub[1 ref] K/REFC,1
290 # 1 <;> nextstate(main 546 (eval 15):1) v
294 # 5 <1> rv2hv[t3] lKRM/1
295 # 6 <1> keys[t4] lK/1
298 # 9 <$> gv(*eldest) s
299 # a <1> rv2av[t1] lKRM*/1
300 # b <2> aassign[t5] KS/COMMON
301 # c <1> leavesub[1 ref] K/REFC,1
307 # chunk: # sort using explicit subroutine name
309 $age{$a} <=> $age{$b}; # presuming numeric
311 @sortedclass = sort byage @class;
315 checkOptree(note => q{},
317 code => q{sub byage { $age{$a} <=> $age{$b}; } @sortedclass = sort byage @class; },
318 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
319 # 1 <;> nextstate(main 597 (eval 30):1) v
322 # 4 <$> const[PV "byage"] s/BARE
324 # 6 <1> rv2av[t4] lK/1
327 # 9 <#> gv[*sortedclass] s
328 # a <1> rv2av[t2] lKRM*/1
329 # b <2> aassign[t5] KS/COMMON
330 # c <1> leavesub[1 ref] K/REFC,1
332 # 1 <;> nextstate(main 546 (eval 15):1) v
335 # 4 <$> const(PV "byage") s/BARE
337 # 6 <1> rv2av[t2] lK/1
340 # 9 <$> gv(*sortedclass) s
341 # a <1> rv2av[t1] lKRM*/1
342 # b <2> aassign[t3] KS/COMMON
343 # c <1> leavesub[1 ref] K/REFC,1
349 # chunk: sub backwards { $b cmp $a }
350 @harry = qw(dog cat x Cain Abel);
351 @george = qw(gone chased yz Punished Axed);
353 # prints AbelCaincatdogx
354 print sort backwards @harry;
355 # prints xdogcatCainAbel
356 print sort @george, 'to', @harry;
357 # prints AbelAxedCainPunishedcatchaseddoggonetoxyz
361 checkOptree(name => q{sort USERSUB LIST },
363 code => q{sub backwards { $b cmp $a }
364 @harry = qw(dog cat x Cain Abel);
365 @george = qw(gone chased yz Punished Axed);
366 print sort @harry; print sort backwards @harry;
367 print sort @george, 'to', @harry; },
368 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
369 # 1 <;> nextstate(main 602 (eval 32):2) v
371 # 3 <$> const[PV "dog"] s
372 # 4 <$> const[PV "cat"] s
373 # 5 <$> const[PV "x"] s
374 # 6 <$> const[PV "Cain"] s
375 # 7 <$> const[PV "Abel"] s
378 # a <1> rv2av[t2] lKRM*/1
379 # b <2> aassign[t3] vKS
380 # c <;> nextstate(main 602 (eval 32):3) v
382 # e <$> const[PV "gone"] s
383 # f <$> const[PV "chased"] s
384 # g <$> const[PV "yz"] s
385 # h <$> const[PV "Punished"] s
386 # i <$> const[PV "Axed"] s
388 # k <#> gv[*george] s
389 # l <1> rv2av[t5] lKRM*/1
390 # m <2> aassign[t6] vKS
391 # n <;> nextstate(main 602 (eval 32):4) v:{
395 # r <1> rv2av[t8] lK/1
398 # u <;> nextstate(main 602 (eval 32):4) v:{
401 # x <$> const[PV "backwards"] s/BARE
403 # z <1> rv2av[t10] lK/1
406 # 12 <;> nextstate(main 602 (eval 32):5) v:{
409 # 15 <#> gv[*george] s
410 # 16 <1> rv2av[t12] lK/1
411 # 17 <$> const[PV "to"] s
412 # 18 <#> gv[*harry] s
413 # 19 <1> rv2av[t14] lK/1
416 # 1c <1> leavesub[1 ref] K/REFC,1
418 # 1 <;> nextstate(main 602 (eval 32):2) v
420 # 3 <$> const(PV "dog") s
421 # 4 <$> const(PV "cat") s
422 # 5 <$> const(PV "x") s
423 # 6 <$> const(PV "Cain") s
424 # 7 <$> const(PV "Abel") s
427 # a <1> rv2av[t1] lKRM*/1
428 # b <2> aassign[t2] vKS
429 # c <;> nextstate(main 602 (eval 32):3) v
431 # e <$> const(PV "gone") s
432 # f <$> const(PV "chased") s
433 # g <$> const(PV "yz") s
434 # h <$> const(PV "Punished") s
435 # i <$> const(PV "Axed") s
437 # k <$> gv(*george) s
438 # l <1> rv2av[t3] lKRM*/1
439 # m <2> aassign[t4] vKS
440 # n <;> nextstate(main 602 (eval 32):4) v:{
444 # r <1> rv2av[t5] lK/1
447 # u <;> nextstate(main 602 (eval 32):4) v:{
450 # x <$> const(PV "backwards") s/BARE
452 # z <1> rv2av[t6] lK/1
455 # 12 <;> nextstate(main 602 (eval 32):5) v:{
458 # 15 <$> gv(*george) s
459 # 16 <1> rv2av[t7] lK/1
460 # 17 <$> const(PV "to") s
461 # 18 <$> gv(*harry) s
462 # 19 <1> rv2av[t8] lK/1
465 # 1c <1> leavesub[1 ref] K/REFC,1
471 # chunk: # inefficiently sort by descending numeric compare using
472 # the first integer after the first = sign, or the
473 # whole record case-insensitively otherwise
475 $nums[$b] <=> $nums[$a]
476 || $caps[$a] cmp $caps[$b]
482 # chunk: # same thing, but without any temps
483 @new = map { $_->[0] }
484 sort { $b->[1] <=> $a->[1]
485 || $a->[2] cmp $b->[2]
486 } map { [$_, /=(\d+)/, uc($_)] } @old;
490 checkOptree(name => q{Compound sort/map Expression },
492 code => q{ @new = map { $_->[0] }
493 sort { $b->[1] <=> $a->[1] || $a->[2] cmp $b->[2] }
494 map { [$_, /=(\d+)/, uc($_)] } @old; },
495 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
496 # 1 <;> nextstate(main 609 (eval 34):3) v:{
502 # 7 <1> rv2av[t19] lKM/1
504 # 9 <|> mapwhile(other->a)[t20] lK
506 # b <;> nextstate(main 608 (eval 34):2) v:{
509 # e </> match(/"=(\\d+)"/) l/RTIME
512 # h <@> anonlist sK*/1
517 # l <|> mapwhile(other->m)[t26] lK
519 # n <1> rv2sv sKM/DREFAV,1
520 # o <1> rv2av[t4] sKR/1
521 # p <$> const[IV 0] s
527 # t <1> rv2av[t2] lKRM*/1
528 # u <2> aassign[t27] KS/COMMON
529 # v <1> leavesub[1 ref] K/REFC,1
531 # 1 <;> nextstate(main 609 (eval 34):3) v:{
537 # 7 <1> rv2av[t10] lKM/1
539 # 9 <|> mapwhile(other->a)[t11] lK
541 # b <;> nextstate(main 608 (eval 34):2) v:{
544 # e </> match(/"=(\\d+)"/) l/RTIME
547 # h <@> anonlist sK*/1
552 # l <|> mapwhile(other->m)[t12] lK
554 # n <1> rv2sv sKM/DREFAV,1
555 # o <1> rv2av[t2] sKR/1
556 # p <$> const(IV 0) s
562 # t <1> rv2av[t1] lKRM*/1
563 # u <2> aassign[t13] KS/COMMON
564 # v <1> leavesub[1 ref] K/REFC,1
570 # chunk: # using a prototype allows you to use any comparison subroutine
571 # as a sort subroutine (including other package's subroutines)
573 sub backwards ($$) { $_[1] cmp $_[0]; } # $a and $b are not set here
575 @new = sort other::backwards @old;
579 checkOptree(name => q{sort other::sub LIST },
581 code => q{package other; sub backwards ($$) { $_[1] cmp $_[0]; }
582 package main; @new = sort other::backwards @old; },
583 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
584 # 1 <;> nextstate(main 614 (eval 36):2) v:{
587 # 4 <$> const[PV "other::backwards"] s/BARE
589 # 6 <1> rv2av[t4] lK/1
593 # a <1> rv2av[t2] lKRM*/1
594 # b <2> aassign[t5] KS/COMMON
595 # c <1> leavesub[1 ref] K/REFC,1
597 # 1 <;> nextstate(main 614 (eval 36):2) v:{
600 # 4 <$> const(PV "other::backwards") s/BARE
602 # 6 <1> rv2av[t2] lK/1
606 # a <1> rv2av[t1] lKRM*/1
607 # b <2> aassign[t3] KS/COMMON
608 # c <1> leavesub[1 ref] K/REFC,1
614 # chunk: # repeat, condensed. $main::a and $b are unaffected
615 sub other::backwards ($$) { $_[1] cmp $_[0]; }
616 @new = sort other::backwards @old;
620 checkOptree(note => q{},
622 code => q{sub other::backwards ($$) { $_[1] cmp $_[0]; } @new = sort other::backwards @old; },
623 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
624 # 1 <;> nextstate(main 619 (eval 38):1) v
627 # 4 <$> const[PV "other::backwards"] s/BARE
629 # 6 <1> rv2av[t4] lK/1
633 # a <1> rv2av[t2] lKRM*/1
634 # b <2> aassign[t5] KS/COMMON
635 # c <1> leavesub[1 ref] K/REFC,1
637 # 1 <;> nextstate(main 546 (eval 15):1) v
640 # 4 <$> const(PV "other::backwards") s/BARE
642 # 6 <1> rv2av[t2] lK/1
646 # a <1> rv2av[t1] lKRM*/1
647 # b <2> aassign[t3] KS/COMMON
648 # c <1> leavesub[1 ref] K/REFC,1
654 # chunk: # guarantee stability, regardless of algorithm
656 @new = sort { substr($a, 3, 5) cmp substr($b, 3, 5) } @old;
660 my ($expect, $expect_nt) = (<<'EOT_EOT', <<'EONT_EONT');
661 # 1 <;> nextstate(main 656 (eval 40):1) v:%,{
665 # 5 <1> rv2av[t9] lK/1
666 # 6 <@> sort lKS*/STABLE
669 # 9 <1> rv2av[t2] lKRM*/1
670 # a <2> aassign[t14] KS/COMMON
671 # b <1> leavesub[1 ref] K/REFC,1
673 # 1 <;> nextstate(main 578 (eval 15):1) v:%,{
677 # 5 <1> rv2av[t5] lK/1
678 # 6 <@> sort lKS*/STABLE
681 # 9 <1> rv2av[t1] lKRM*/1
682 # a <2> aassign[t6] KS/COMMON
683 # b <1> leavesub[1 ref] K/REFC,1
687 # 5.8.x doesn't show the /STABLE flag, so massage the golden results.
688 s!/STABLE!!s foreach ($expect, $expect_nt);
691 checkOptree(note => q{},
693 code => q{use sort 'stable'; @new = sort { substr($a, 3, 5) cmp substr($b, 3, 5) } @old; },
694 expect => $expect, expect_nt => $expect_nt);
698 # chunk: # force use of mergesort (not portable outside Perl 5.8)
699 use sort '_mergesort';
700 @new = sort { substr($a, 3, 5) cmp substr($b, 3, 5) } @old;
704 checkOptree(note => q{},
706 code => q{use sort '_mergesort'; @new = sort { substr($a, 3, 5) cmp substr($b, 3, 5) } @old; },
707 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
708 # 1 <;> nextstate(main 662 (eval 42):1) v:%,{
712 # 5 <1> rv2av[t9] lK/1
716 # 9 <1> rv2av[t2] lKRM*/1
717 # a <2> aassign[t14] KS/COMMON
718 # b <1> leavesub[1 ref] K/REFC,1
720 # 1 <;> nextstate(main 578 (eval 15):1) v:%,{
724 # 5 <1> rv2av[t5] lK/1
728 # 9 <1> rv2av[t1] lKRM*/1
729 # a <2> aassign[t6] KS/COMMON
730 # b <1> leavesub[1 ref] K/REFC,1
736 # chunk: # you should have a good reason to do this!
737 @articles = sort {$FooPack::b <=> $FooPack::a} @files;
741 checkOptree(note => q{},
743 code => q{@articles = sort {$FooPack::b <=> $FooPack::a} @files; },
744 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
745 # 1 <;> nextstate(main 667 (eval 44):1) v
749 # 5 <1> rv2av[t7] lK/1
752 # 8 <#> gv[*articles] s
753 # 9 <1> rv2av[t2] lKRM*/1
754 # a <2> aassign[t8] KS/COMMON
755 # b <1> leavesub[1 ref] K/REFC,1
757 # 1 <;> nextstate(main 546 (eval 15):1) v
761 # 5 <1> rv2av[t3] lK/1
764 # 8 <$> gv(*articles) s
765 # 9 <1> rv2av[t1] lKRM*/1
766 # a <2> aassign[t4] KS/COMMON
767 # b <1> leavesub[1 ref] K/REFC,1
774 @result = sort { $a <=> $b } grep { $_ == $_ } @input;
778 checkOptree(note => q{},
780 code => q{@result = sort { $a <=> $b } grep { $_ == $_ } @input; },
781 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
782 # 1 <;> nextstate(main 673 (eval 46):1) v
787 # 6 <1> rv2av[t9] lKM/1
788 # 7 <@> grepstart lK*
789 # 8 <|> grepwhile(other->9)[t10] lK
797 # e <#> gv[*result] s
798 # f <1> rv2av[t2] lKRM*/1
799 # g <2> aassign[t3] KS/COMMON
800 # h <1> leavesub[1 ref] K/REFC,1
802 # 1 <;> nextstate(main 547 (eval 15):1) v
807 # 6 <1> rv2av[t3] lKM/1
808 # 7 <@> grepstart lK*
809 # 8 <|> grepwhile(other->9)[t4] lK
817 # e <$> gv(*result) s
818 # f <1> rv2av[t1] lKRM*/1
819 # g <2> aassign[t2] KS/COMMON
820 # h <1> leavesub[1 ref] K/REFC,1
826 # chunk: # void return context sort
827 sort { $a <=> $b } @input;
831 checkOptree(note => q{},
833 code => q{sort { $a <=> $b } @input; },
834 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
835 # 1 <;> nextstate(main 678 (eval 48):1) v
838 # 4 <1> rv2av[t5] lK/1
840 # 6 <1> leavesub[1 ref] K/REFC,1
842 # 1 <;> nextstate(main 546 (eval 15):1) v
845 # 4 <1> rv2av[t2] lK/1
847 # 6 <1> leavesub[1 ref] K/REFC,1
853 # chunk: # more void context, propagating ?
854 sort { $a <=> $b } grep { $_ == $_ } @input;
858 checkOptree(note => q{},
860 code => q{sort { $a <=> $b } grep { $_ == $_ } @input; },
861 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
862 # 1 <;> nextstate(main 684 (eval 50):1) v
866 # 5 <1> rv2av[t7] lKM/1
867 # 6 <@> grepstart lK*
868 # 7 <|> grepwhile(other->8)[t8] lK
875 # c <1> leavesub[1 ref] K/REFC,1
877 # 1 <;> nextstate(main 547 (eval 15):1) v
881 # 5 <1> rv2av[t2] lKM/1
882 # 6 <@> grepstart lK*
883 # 7 <|> grepwhile(other->8)[t3] lK
890 # c <1> leavesub[1 ref] K/REFC,1
896 # chunk: # scalar return context sort
897 $s = sort { $a <=> $b } @input;
901 checkOptree(note => q{},
903 code => q{$s = sort { $a <=> $b } @input; },
904 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
905 # 1 <;> nextstate(main 689 (eval 52):1) v:{
908 # 4 <1> rv2av[t6] lK/1
911 # 7 <2> sassign sKS/2
912 # 8 <1> leavesub[1 ref] K/REFC,1
914 # 1 <;> nextstate(main 546 (eval 15):1) v:{
917 # 4 <1> rv2av[t2] lK/1
920 # 7 <2> sassign sKS/2
921 # 8 <1> leavesub[1 ref] K/REFC,1
927 # chunk: $s = sort { $a <=> $b } grep { $_ == $_ } @input;
931 checkOptree(note => q{},
933 code => q{$s = sort { $a <=> $b } grep { $_ == $_ } @input; },
934 expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
935 # 1 <;> nextstate(main 695 (eval 54):1) v:{
939 # 5 <1> rv2av[t8] lKM/1
940 # 6 <@> grepstart lK*
941 # 7 <|> grepwhile(other->8)[t9] lK
949 # d <2> sassign sKS/2
950 # e <1> leavesub[1 ref] K/REFC,1
952 # 1 <;> nextstate(main 547 (eval 15):1) v:{
956 # 5 <1> rv2av[t2] lKM/1
957 # 6 <@> grepstart lK*
958 # 7 <|> grepwhile(other->8)[t3] lK
966 # d <2> sassign sKS/2
967 # e <1> leavesub[1 ref] K/REFC,1