From: Matt S Trout Date: Thu, 23 Jun 2016 17:30:06 +0000 (+0000) Subject: switch force_backtrack to execute a backtrack step X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bc7cb6357fbec806ed7d87d356fd2f4453690320;p=scpubgit%2FDX.git switch force_backtrack to execute a backtrack step --- diff --git a/lib/DX/SearchState.pm b/lib/DX/SearchState.pm index 18979e7..dcfb606 100644 --- a/lib/DX/SearchState.pm +++ b/lib/DX/SearchState.pm @@ -44,12 +44,9 @@ sub force_backtrack { my ($first_alt, @rest_alt) = @{$self->alternatives}; return undef unless $first_alt; trace 'search.backtrack.forced' => $first_alt->[0]; - return ref($self)->new( - current_hypothesis => $first_alt->[0], - next_step => $first_alt->[1], - alternatives => \@rest_alt, - propositions => $self->propositions, - ); + return $self->but( + next_step => DX::Step::Backtrack->new, + )->with_one_step; } 1;