From: Matt S Trout Date: Wed, 3 Aug 2016 17:29:40 +0000 (+0000) Subject: re-add basic step tracing X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=56f901616f4140a1203d92d1ae03f7972665fa99;p=scpubgit%2FDX.git re-add basic step tracing --- diff --git a/lib/DX/Deparse.pm b/lib/DX/Deparse.pm index 5350b58..7326775 100644 --- a/lib/DX/Deparse.pm +++ b/lib/DX/Deparse.pm @@ -181,12 +181,32 @@ sub _fmt_searchstate { ], $meta); } -sub _fmt_step_normal { +sub _fmt_step_considerproposition { my ($self, $step, $meta) = @_; - $self->_fmt_object([ + 'consider '.$self->_fmt($step->proposition, $meta); +} + +sub _fmt_step_resolveproposition { + my ($self, $step, $meta) = @_; + 'resolve '.$self->_fmt_object([ [ actions => $step->actions ], - [ alternative_step => $step->alternative_step ], + ($step->alternative_step + ? [ alternative_step => '...' ] + : ()), ], $meta); } +sub _fmt_step_backtrack { 'backtrack' } + +sub _fmt_step_markassolution { 'mark as solution' } + +sub _fmt_step_enterrecheck { + my ($self, $step, $meta) = @_; + 'recheck '.$self->_fmt($step->proposition_list->[0], $meta); +} + +sub _fmt_step_completerecheck { 'complete recheck' } + +sub _fmt_step_failrecheck { 'fail recheck' } + 1; diff --git a/lib/DX/SearchState.pm b/lib/DX/SearchState.pm index 78b7528..1742ff5 100644 --- a/lib/DX/SearchState.pm +++ b/lib/DX/SearchState.pm @@ -51,6 +51,7 @@ sub new_for { sub with_one_step { my ($self) = @_; return undef unless my $step = $self->next_step; + trace step => $step; return $step->apply_to($self); }