From: Matt S Trout Date: Mon, 20 Jun 2016 00:38:33 +0000 (+0000) Subject: move invoke predicate logic into normal step X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f696251fa8f0d2648e89a3ab46c676593a9a1798;p=scpubgit%2FDX.git move invoke predicate logic into normal step --- diff --git a/lib/DX/SearchState.pm b/lib/DX/SearchState.pm index b1b4038..005aa3c 100644 --- a/lib/DX/SearchState.pm +++ b/lib/DX/SearchState.pm @@ -45,9 +45,6 @@ sub with_one_step { : ()), @{$new_ss->alternatives} ], - next_step => DX::Step::InvokeNextPredicate->new( - proposition => $new_ss->next_proposition, - ), ); } if ($alt_step) { diff --git a/lib/DX/Step/Normal.pm b/lib/DX/Step/Normal.pm index 350d4dc..10c4eb9 100644 --- a/lib/DX/Step/Normal.pm +++ b/lib/DX/Step/Normal.pm @@ -32,7 +32,16 @@ sub apply_to { 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 ($ss->but(current_hypothesis => $new_hyp), $self->alternative_step); + my $ns = DX::Step::InvokeNextPredicate->new( + proposition => $ss->next_proposition($new_hyp) + ); + return ( + $ss->but( + current_hypothesis => $new_hyp, + next_step => $ns, + ), + $self->alternative_step + ); } sub _apply_to_hyp {