From: Matt S Trout Date: Wed, 16 Mar 2016 14:41:07 +0000 (+0000) Subject: better tracing in SearchState X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=72e5c0e050918a9f3edfce686ffbdcf965f7822f;p=scpubgit%2FDX.git better tracing in SearchState --- diff --git a/lib/DX/SearchState.pm b/lib/DX/SearchState.pm index c1aae18..4d81d48 100644 --- a/lib/DX/SearchState.pm +++ b/lib/DX/SearchState.pm @@ -38,9 +38,11 @@ sub with_one_step { resume_step => undef, ); } + trace 'search.backtrack.alt' => $alt_step; $step = $alt_step; } ($hyp, $step) = @{shift(@alt)||[]}; + trace 'search.backtrack.rewind_to' => $step; } return undef; } @@ -50,6 +52,7 @@ sub find_solution { while ($state and @{$state->current_hypothesis->outstanding_propositions}) { $state = $state->with_one_step; } + trace 'search.solution.hyp' => $state->current_hypothesis if $state; return $state; } @@ -57,7 +60,7 @@ sub force_backtrack { my ($self) = @_; my ($first_alt, @rest_alt) = @{$self->alternatives}; return undef unless $first_alt; - trace 'search.backtrack' => $first_alt->[0]; + trace 'search.backtrack.forced' => $first_alt->[0]; return ref($self)->new( current_hypothesis => $first_alt->[0], resume_step => $first_alt->[1],