From: Matt S Trout Date: Mon, 16 Apr 2018 02:15:34 +0000 (+0000) Subject: move resolution step construction later X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=353951dc21147a4a4e65ffa611076e44f8028130;p=scpubgit%2FDX.git move resolution step construction later --- diff --git a/lib/DX/Step/ResolveProposition.pm b/lib/DX/Step/ResolveProposition.pm index d1ad465..6cf99b9 100644 --- a/lib/DX/Step/ResolveProposition.pm +++ b/lib/DX/Step/ResolveProposition.pm @@ -52,28 +52,28 @@ sub apply_to { ] ], ] ] ] ]; - my $ss = $old_ss->but( - next_step => DX::Step::CompleteResolution->new( - original_search_state => $old_ss, - resolution_space => $rspace, - ) - ); my $old_hyp = $old_ss->current_hypothesis; (my $hyp, my @recheck) = $old_hyp->with_resolution( $prop, $vdeps, $res->actions ); unless ($hyp) { - return $ss->but( + return $old_ss->but( next_step => $rspace->remaining_resolution_space->next_step ); } - return $ss->but(current_hypothesis => $hyp) unless @recheck; - return $ss->but( + my $next_step = DX::Step::CompleteResolution->new( + original_search_state => $old_ss, + resolution_space => $rspace, + ); + unless (@recheck) { + return $old_ss->but(next_step => $next_step, current_hypothesis => $hyp); + } + return $old_ss->but( current_hypothesis => $hyp, next_step => DX::Step::EnterRecheck->new( proposition_list => \@recheck, - on_completion_step => $ss->next_step, + on_completion_step => $next_step, resolution_space => $rspace, ), );