From: Matt S Trout Date: Tue, 21 Jun 2016 19:47:46 +0000 (+0000) Subject: add alternatives to search state inside normal step X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=96e5344d59892e81cf43281631b38265fe7d8a50;p=scpubgit%2FDX.git add alternatives to search state inside normal step --- diff --git a/lib/DX/Step/Normal.pm b/lib/DX/Step/Normal.pm index 10c4eb9..2ec93aa 100644 --- a/lib/DX/Step/Normal.pm +++ b/lib/DX/Step/Normal.pm @@ -35,12 +35,16 @@ sub apply_to { my $ns = DX::Step::InvokeNextPredicate->new( proposition => $ss->next_proposition($new_hyp) ); + my $alt_step = $self->alternative_step; return ( $ss->but( current_hypothesis => $new_hyp, next_step => $ns, + ($alt_step + ? (alternatives => [ [ $old_hyp, $alt_step ], @{$ss->alternatives} ]) + : () + ), ), - $self->alternative_step ); }