From: Rafael Garcia-Suarez Date: Thu, 18 Nov 2004 22:06:21 +0000 (+0000) Subject: Remaining nit in the deparsing of reversed foreach loops X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aae53c41000e94361e4c42bf38e7e4f6393c512e;p=p5sagit%2Fp5-mst-13.2.git Remaining nit in the deparsing of reversed foreach loops p4raw-id: //depot/perl@23516 --- diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index 5d6b87e..8b31e6f 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -2503,7 +2503,7 @@ sub loop_common { my $var = $ary->sibling; if ($ary->name eq 'null' and $enter->private & OPpITER_REVERSED) { # "reverse" was optimised away - $ary = "reverse " . $self->deparse($ary->first->sibling->first->sibling, 1); + $ary = listop($self, $ary->first->sibling, 1, 'reverse'); } elsif ($enter->flags & OPf_STACKED and not null $ary->first->sibling->sibling) { diff --git a/ext/B/t/deparse.t b/ext/B/t/deparse.t index 9439ac9..033bdd5 100644 --- a/ext/B/t/deparse.t +++ b/ext/B/t/deparse.t @@ -20,7 +20,7 @@ use warnings; use strict; use Config; -print "1..36\n"; +print "1..37\n"; use B::Deparse; my $deparse = B::Deparse->new() or print "not "; @@ -281,3 +281,7 @@ print((reverse sort {$b <=> $a} @x)); # 32 our @a; print $_ foreach (reverse @a); +#### +# 32 +our @a; +print $_ foreach (reverse 1, 2..5);