add some basic tracing using the new deparser
[scpubgit/DX.git] / lib / DX / Step / EnterRecheck.pm
index 4d48553..a1954a1 100644 (file)
@@ -7,17 +7,24 @@ use DX::Class;
 
 with 'DX::Role::Step';
 
-has proposition_list => (is => 'ro', required => 1);
+has proposition_list => (
+  is => 'ro', isa => PropositionList, required => 1
+);
 
-has on_completion_step => (is => 'ro', required => 1);
+has on_completion_step => (is => 'ro', isa => Step, required => 1);
 
-has on_failure_step => (is => 'ro', required => 1);
+has on_failure_step => (is => 'ro', isa => Maybe[Step], required => 1);
 
 sub apply_to {
   my ($self, $old_ss) = @_;
 
   my ($prop, @rest) = @{$self->proposition_list};
 
+  trace recheck => [ statement => [
+    [ symbol => 'recheck' ],
+    @{$prop->for_deparse->[1]},
+  ] ];
+
   my $old_hyp = $old_ss->current_hypothesis;
 
   # we should probably be doing something about pruning the scope
@@ -47,11 +54,9 @@ sub apply_to {
                     ? $self->but(proposition_list => \@rest)
                     : $self->on_completion_step);
 
-  trace 'step.recheck.hyp' => $hyp;
-
   my $ss = DX::SearchState->new(
     current_hypothesis => $hyp,
-    alternatives => [],
+    adjustments_made => [],
     propositions => $pseq,
     next_step => DX::Step::ConsiderProposition->new(
                    proposition => $prop,