From: Stephen McCamant Date: Fri, 10 Jul 1998 23:46:46 +0000 (-0500) Subject: more complete version of change#1421 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d7f5b6dab2a427b08f79704a287bcc3f5231f4d8;p=p5sagit%2Fp5-mst-13.2.git more complete version of change#1421 Message-ID: <13734.58994.735473.859218@alias-2.pr.mcs.net> Subject: [PATCH] Re: B::Deparse for(1..100000) p4raw-link: @1421 on //depot/perl: d8d95777eda225e5e5adb348f812ffc22a87caf5 p4raw-id: //depot/perl@1436 --- diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index d9b0cd9..337c173 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -9,7 +9,7 @@ package B::Deparse; use Carp 'cluck'; use B qw(class main_root main_start main_cv svref_2object); -$VERSION = 0.53; +$VERSION = 0.54; use strict; # Changes between 0.50 and 0.51: @@ -30,6 +30,9 @@ use strict; # - many changes adding precedence contexts and associativity # - added `-p' and `-s' output style options # - various other minor fixes +# Changes between 0.53 and 0.54 +# - added support for new `for (1..100)' optimization, +# thanks to Gisle Aas # Todo: # - {} around variables in strings ("${var}letters") @@ -1514,10 +1517,8 @@ sub pp_leaveloop { my $ary = $enter->first->sibling; # first was pushmark my $var = $ary->sibling; if ($enter->flags & OPf_STACKED) { - my $from = $ary->first->sibling; - my $to = $from->sibling; - $ary = join("", "(", $self->deparse($from,1), " .. ", - $self->deparse($to,1), ")"); + $ary = $self->deparse($ary->first->sibling, 9) . " .. " . + $self->deparse($ary->first->sibling->sibling, 9); } else { $ary = $self->deparse($ary, 1); }