From: Matt S Trout Date: Fri, 30 Mar 2018 16:43:58 +0000 (+0000) Subject: move backtrack step creation into rspace X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d69f4df43a8e53a1853113acb564b7fce6ac3957;p=scpubgit%2FDX.git move backtrack step creation into rspace --- diff --git a/lib/DX/ResolutionSpace.pm b/lib/DX/ResolutionSpace.pm index 4210b02..c2bfff6 100644 --- a/lib/DX/ResolutionSpace.pm +++ b/lib/DX/ResolutionSpace.pm @@ -1,6 +1,7 @@ package DX::ResolutionSpace; use DX::Utils qw(step); +use DX::Step::Backtrack; use DX::Class; has proposition => (is => 'ro'); @@ -23,7 +24,7 @@ sub remaining_resolution_space { sub next_step { my ($self) = @_; - return undef unless @{$self->members}; + return DX::Step::Backtrack->new unless @{$self->members}; return step( resolves => $self->proposition, resolution_space => $self, diff --git a/lib/DX/Step/ConsiderProposition.pm b/lib/DX/Step/ConsiderProposition.pm index 0b60a82..485d14b 100644 --- a/lib/DX/Step/ConsiderProposition.pm +++ b/lib/DX/Step/ConsiderProposition.pm @@ -15,10 +15,7 @@ sub apply_to { @{$self->proposition->for_deparse->[1]}, ], ]; - if (my $step = $self->proposition->resolve_for($hyp->scope)) { - return $ss->but(next_step => $step); - } - return $ss->but(next_step => DX::Step::Backtrack->new); + return $ss->but(next_step => $self->proposition->resolve_for($hyp->scope)); } 1;