]> git.vpit.fr Git - perl/modules/Sub-Nary.git/blobdiff - lib/Sub/Nary.pm
Simplify pp_entersub argument list logic and improve coverage with a test
[perl/modules/Sub-Nary.git] / lib / Sub / Nary.pm
index 838fab0c7cfd79dfa807c6473311439894f7a872..ee5fb6491ca60410c857f3f0d546b35ba0f9a54d 100644 (file)
@@ -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;
  }