my $hyp = $self->current_hypothesis;
return undef unless my $step = $self->next_step;
my ($first_alt, @rest_alt) = my @alt = @{$self->alternatives};
- my ($new_hyp, $alt_step) = $step->apply_to($hyp);
+ my ($new_ss, $alt_step) = $step->apply_to($self);
+ my $new_hyp = ($new_ss ? $new_ss->current_hypothesis : undef);
if ($new_hyp) {
return $self->but(
current_hypothesis => $new_hyp,
has proposition => (is => 'ro', required => 1);
sub apply_to {
- my ($self, $hyp) = @_;
+ my ($self, $ss) = @_;
+ my $hyp = $ss->current_hypothesis;
return (undef, $self->proposition->resolve_for($hyp->scope));
}
}
sub apply_to {
- my ($self, $old_hyp) = @_;
+ my ($self, $ss) = @_;
+ my $old_hyp = $ss->current_hypothesis;
trace 'step.apply.old_hyp '.$self => $old_hyp;
trace 'step.apply.actions '.$self => $self->actions;
my $new_hyp = $self->_apply_to_hyp($old_hyp);
return (undef, $self->alternative_step) unless $new_hyp;
trace 'step.apply.new_hyp '.$self => $new_hyp;
- return ($new_hyp, $self->alternative_step);
+ return ($ss->but(current_hypothesis => $new_hyp), $self->alternative_step);
}
sub _apply_to_hyp {