From: Matt S Trout Date: Sun, 22 Apr 2018 18:35:13 +0000 (+0000) Subject: format aperture in backtrack trace X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=HEAD;p=scpubgit%2FDX.git format aperture in backtrack trace --- diff --git a/fragment.output/btdemo b/fragment.output/btdemo index e0a5ff3..681eb96 100644 --- a/fragment.output/btdemo +++ b/fragment.output/btdemo @@ -134,9 +134,15 @@ recheck eq ?X {{ a 1 b 2 c 3 }} { } backtrack { failure_dependencies { CONTENTS_OF 0.X; CONTENTS_OF 0.XValue } - decision { for member_at Y ?YKey ?YValue } + decision { + for member_at Y ?YKey ?YValue + aperture { VALUE_SET 0.YKey; VALUE_SET 0.YValue } + } non_relevant - decision { for member_at X ?XKey ?XValue } + decision { + for member_at X ?XKey ?XValue + aperture { VALUE_SET 0.XKey; VALUE_SET 0.XValue } + } found_alternative } resolve { @@ -218,9 +224,12 @@ recheck eq ?Y {{ d 1 e 2 f 3 }} { } backtrack { failure_dependencies { CONTENTS_OF 0.Y; CONTENTS_OF 0.YValue } - decision { for eq XValue 2 } + decision { for eq XValue 2 aperture { VALUE_SET 0.XValue; VALUE_SET 0.X.b } } non_relevant - decision { for member_at Y ?YKey ?YValue } + decision { + for member_at Y ?YKey ?YValue + aperture { VALUE_SET 0.YKey; VALUE_SET 0.YValue } + } found_alternative } resolve { @@ -318,23 +327,29 @@ recheck eq ?Y {{ d 1 e 2 f 3 }} { } backtrack { failure_dependencies { CONTENTS_OF 0.Y; CONTENTS_OF 0.YValue } - decision { for eq XValue 2 } + decision { for eq XValue 2 aperture { VALUE_SET 0.XValue; VALUE_SET 0.X.b } } non_relevant - decision { for member_at Y ?YKey ?YValue } + decision { + for member_at Y ?YKey ?YValue + aperture { VALUE_SET 0.YKey; VALUE_SET 0.YValue } + } failure_dependencies { CONTENTS_OF 0.Y TYPE_OF 0.YKey CONTENTS_OF 0.YValue } - decision { for member_at X ?XKey ?XValue } + decision { + for member_at X ?XKey ?XValue + aperture { VALUE_SET 0.XKey; VALUE_SET 0.XValue } + } non_relevant - decision { for eq ?Y {{ d 1 e 2 f 3 }} } + decision { for eq ?Y {{ d 1 e 2 f 3 }} aperture { VALUE_SET 0.Y } } failure_dependencies { CONTENTS_OF 0.Y TYPE_OF 0.YKey CONTENTS_OF 0.YValue } - decision { for eq ?X {{ a 1 b 2 c 3 }} } + decision { for eq ?X {{ a 1 b 2 c 3 }} aperture { VALUE_SET 0.X } } non_relevant exhaustion } diff --git a/lib/DX/Step/Backtrack.pm b/lib/DX/Step/Backtrack.pm index 81335ac..0da00a6 100644 --- a/lib/DX/Step/Backtrack.pm +++ b/lib/DX/Step/Backtrack.pm @@ -28,8 +28,13 @@ sub apply_to { trace backtrack => [ statement => [ [ symbol => 'decision' ], [ pairs => [ - [ for => $rspace_was->proposition, ] - #aperture => + [ for => $rspace_was->proposition, ], + [ aperture => [ block => [ + map [ statement => [ + [ symbol => (split '::', ${$_->[0]})[-1] ], + [ value_path => [ @{$_}[1..$#$_] ] ], + ] ], @{$rspace_was->aperture} + ] ] ] ] ] ] ]; foreach my $event (@{$rspace_was->aperture}) {