]> git.vpit.fr Git - perl/modules/Sub-Nary.git/blobdiff - lib/Sub/Nary.pm
Add support and tests for eval { }
[perl/modules/Sub-Nary.git] / lib / Sub / Nary.pm
index f408f8c50ff5fdd31d42ab622e401c8a8b4cf329..c44a10e9bf8fb6d73541a8cbb48829b396192403 100644 (file)
@@ -207,6 +207,7 @@ $ops{$_} = 'list' for qw/padany flip match/;
 sub enter {
  my ($self, $cv) = @_;
 
+ return 'list' if class($cv) ne 'CV';
  my $op  = $cv->ROOT;
  my $tag = tag($op);
 
@@ -278,7 +279,7 @@ sub expect_any {
 
  return ($self->expect_list($op))[0] => 1 if name($op) eq 'return';
 
- if (class($op) eq 'LOGOP') {
+ if (class($op) eq 'LOGOP' and not null $op->first) {
   my @res;
   my ($p, $r);
 
@@ -304,7 +305,7 @@ sub expect_any {
  return $self->expect_list($op);
 }
 
-# Stolen from Sub::Deparse
+# Stolen from B::Deparse
 
 sub padval { $_[0]->{cv}->[0]->PADLIST->ARRAYelt(1)->ARRAYelt($_[1]) }