]> git.vpit.fr Git - perl/modules/B-RecDeparse.git/commitdiff
Reverse logic for _recurse
authorVincent Pit <vince@profvince.com>
Thu, 31 Jul 2008 21:27:48 +0000 (23:27 +0200)
committerVincent Pit <vince@profvince.com>
Thu, 31 Jul 2008 21:27:48 +0000 (23:27 +0200)
lib/B/RecDeparse.pm

index 37eb15085c91052ea3575cbea339376ad68ddb67..7244ec59e337b6174e8552216f66c8b23dd4cac1 100644 (file)
@@ -82,7 +82,7 @@ sub new {
 }
 
 sub _recurse {
- return $_[0]->{brd_level} >= 0 && $_[0]->{brd_cur} >= $_[0]->{brd_level}
+ return $_[0]->{brd_level} < 0 || $_[0]->{brd_cur} < $_[0]->{brd_level}
 }
 
 sub compile {
@@ -125,7 +125,7 @@ sub pp_entersub {
  $self->{brd_sub} = 1;
  my $body = $self->SUPER::pp_entersub(@_);
  $self->{brd_sub} = 0;
- $body =~ s/^&\s*(\w)/$1/ if not $self->_recurse;
+ $body =~ s/^&\s*(\w)/$1/ if $self->_recurse;
  return $body;
 }
 
@@ -140,7 +140,7 @@ sub pp_refgen {
 sub pp_gv {
  my $self = shift;
  my $body;
- if ($self->{brd_sub} <= 0 || $self->_recurse) {
+ if ($self->{brd_sub} <= 0 || !$self->_recurse) {
   $body = $self->SUPER::pp_gv(@_);
  } else {
   my $gv = $self->gv_or_padgv($_[0]);