]> git.vpit.fr Git - perl/modules/Sub-Nary.git/blobdiff - lib/Sub/Nary.pm
Get the good count in aassign. Fixes successive arrays assignments and goatse operato...
[perl/modules/Sub-Nary.git] / lib / Sub / Nary.pm
index 707a2e627ee25228b9bc20432c6237014c661d3e..a6b97e0f401d0ab56a0b47281c7cc817ce22eff7 100644 (file)
@@ -441,7 +441,17 @@ sub pp_rv2av {
  return (name($op) eq 'const') ? $self->expect_any($op) : 'list';
 }
 
-sub pp_aassign { $_[0]->expect_any($_[1]->first) }
+sub pp_aassign {
+ my ($self, $op) = @_;
+
+ $op = $op->first;
+
+ # Can't assign to return
+ my ($p, $r) = $self->expect_list($op->sibling);
+ return $p => 0 if not exists $p->{list};
+
+ $self->expect_any($op);
+}
 
 sub pp_leaveloop { $_[0]->expect_return($_[1]->first->sibling) }