remove alternative addition handling from search state
Matt S Trout [Tue, 21 Jun 2016 19:48:18 +0000 (19:48 +0000)]
lib/DX/SearchState.pm

index 005aa3c..9562373 100644 (file)
@@ -36,20 +36,8 @@ sub with_one_step {
   my ($self) = @_;
   my $hyp = $self->current_hypothesis;
   return undef unless my $step = $self->next_step;
-  my ($new_ss, $alt_step) = $step->apply_to($self);
-  if ($new_ss) {
-    return $new_ss->but(
-      alternatives => [
-        ($alt_step
-          ? [ $hyp, $alt_step ]
-          : ()),
-        @{$new_ss->alternatives}
-      ],
-    );
-  }
-  if ($alt_step) {
-    return $self->but(next_step => $alt_step);
-  }
+  my ($new_ss) = $step->apply_to($self);
+  return $new_ss if $new_ss;
   my ($first_alt, @rest_alt) = @{$self->alternatives};
   return undef unless $first_alt;
   trace 'search.backtrack.rewind_to' => $first_alt->[1];