Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix sigspace not respecting :r optimization
  • Loading branch information
sorear committed Sep 8, 2010
1 parent b939063 commit ffb2ed0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/Optimizer/RxSimple.pm
Expand Up @@ -62,4 +62,15 @@ sub RxOp::Subrule::mayback { my ($self) = @_;
return !$self->selfcut;
}

sub RxOp::Sigspace::rxsimp { my ($self, $cut) = @_;
if ($cut) {
return RxOp::Sigspace->new(selfcut => 1);
}
return $self;
}

sub RxOp::Sigspace::mayback { my ($self) = @_;
return !$self->selfcut;
}

1;
4 changes: 3 additions & 1 deletion src/RxOp.pm
Expand Up @@ -358,10 +358,12 @@ use CgOp;
package RxOp::Sigspace;
use Moose;
extends 'RxOp';
has selfcut => (isa => 'Bool', is => 'ro', default => 0);

sub code {
my ($self, $body) = @_;
RxOp::Subrule->new(name => 'ws')->code($body);
RxOp::Subrule->new(name => 'ws',
selfcut => $self->selfcut)->code($body);
}

sub lad {
Expand Down

0 comments on commit ffb2ed0

Please sign in to comment.