X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FSub%2FNary.pm;h=b87eaefc48736e2256b048e67517b94ce313700b;hb=refs%2Ftags%2Fv0.03;hp=838fab0c7cfd79dfa807c6473311439894f7a872;hpb=1757c35d2d60dd9b52dcbd5af09679cfdaeb1740;p=perl%2Fmodules%2FSub-Nary.git diff --git a/lib/Sub/Nary.pm b/lib/Sub/Nary.pm index 838fab0..b87eaef 100644 --- a/lib/Sub/Nary.pm +++ b/lib/Sub/Nary.pm @@ -15,13 +15,13 @@ Sub::Nary - Try to count how many elements a subroutine can return in list conte =head1 VERSION -Version 0.02 +Version 0.03 =cut our $VERSION; BEGIN { - $VERSION = '0.02'; + $VERSION = '0.03'; } =head1 SYNOPSIS @@ -353,14 +353,9 @@ sub pp_entersub { my $r; my $c = 1; for (; not null $op->sibling; $op = $op->sibling) { - my $n = name($op); - next if $n eq 'nextstate'; my ($rc, $lc) = $self->inspect($op); - $r = add $r, scale $c, $rc if defined $rc; - if (zero $lc) { - $c = 1 - count $r; - return $r, $c ? { 0 => $c } : undef - } + return $rc, $lc if defined $rc and not defined $lc; + $r = add $r, scale $c, $rc; $c *= count $lc; }