From: Matt S Trout Date: Fri, 4 Dec 2015 16:20:05 +0000 (+0000) Subject: slightly less incomplete deparse output X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=39351e10a6952c3249854f7a069736b7f1f2ec3c;p=scpubgit%2FDX.git slightly less incomplete deparse output --- diff --git a/lib/DX/Deparse.pm b/lib/DX/Deparse.pm index ea96412..ba41df6 100644 --- a/lib/DX/Deparse.pm +++ b/lib/DX/Deparse.pm @@ -90,6 +90,11 @@ sub _fmt_array { "{\n${chunks}\n}"; } +sub _fmt_glob { + my ($self, $glob, $meta) = @_; + return ((''.*$glob) =~ /::([A-Z_]+)$/)[0]; +} + sub _fmt_action_setvalue { my ($self, $action, $meta) = @_; $self->_fmt_action_generic(SetValue => $action, $meta); @@ -108,7 +113,11 @@ sub _fmt_action_generic { sub _fmt_resolvedpropositionset { my ($self, $rps, $meta) = @_; - $self->_fmt($rps->propositions, $meta); + $self->_fmt_object([ + map { + [ $_, $rps->dependencies_for($_) ] + } @{$rps->propositions}, + ], $meta); } sub _fmt_proposition { diff --git a/t/01basics.t b/t/01basics.t index fa69c59..4bdfda1 100644 --- a/t/01basics.t +++ b/t/01basics.t @@ -43,6 +43,7 @@ my $ss = use_module('DX::SearchState')->new( ); #::Dwarn($ss->with_one_step->with_one_step); -warn deparse(my $f = $ss->with_one_step->with_one_step->with_one_step); +warn deparse(my $f = $ss->with_one_step->with_one_step); +warn deparse($f->with_one_step); -::Dwarn($f->current_hypothesis->resolved_propositions->dependency_map); +#::Dwarn($f->current_hypothesis->resolved_propositions->dependency_map);