]> git.vpit.fr Git - perl/modules/Sub-Nary.git/blobdiff - lib/Sub/Nary.pm
Correct mailing list
[perl/modules/Sub-Nary.git] / lib / Sub / Nary.pm
index ef92fa178aab2f41bef787150aae2aec7b6ffca1..eaa378e1aead72279fdf2231aff9c5584a2e18e1 100644 (file)
@@ -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;
  }
 
@@ -446,12 +441,20 @@ sub pp_rv2av {
  my ($self, $op) = @_;
  $op = $op->first;
 
- my ($r, $l) = $self->inspect($op);
- if (name($op) ne 'const') {
-  my $c = 1 - count $r;
-  $l = $c ? { list => $c } : 0;
+ if (name($op) eq 'gv') {
+  return undef, { list => 1 };
  }
- return $r, $l; 
+
+ $self->inspect($op);
+}
+
+sub pp_sassign {
+ my ($self, $op) = @_;
+
+ my $r = ($self->inspect($op->first))[0];
+
+ my $c = 1 - count $r;
+ return $r, $c ? { 1 => $c } : undef
 }
 
 sub pp_aassign {
@@ -602,7 +605,7 @@ You can contact me by mail or on #perl @ FreeNode (vincent or Prof_Vince).
 
 =head1 BUGS
 
-Please report any bugs or feature requests to C<bug-b-nary at rt.cpan.org>, or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Sub-Nary>.  I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
+Please report any bugs or feature requests to C<bug-sub-nary at rt.cpan.org>, or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Sub-Nary>.  I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
 
 =head1 SUPPORT