much better indentation on traces
[scpubgit/DX.git] / lib / DX / Resolution.pm
CommitLineData
9d759b64 1package DX::Resolution;
2
c99dbb05 3use DX::Utils qw(expand_deps);
9d759b64 4use DX::Class;
5
7f385fb2 6has veracity_depends_on => (is => 'ro', required => 1);
9d759b64 7
7f385fb2 8has actions => (is => 'ro', required => 1);
9d759b64 9
113f21b9 10sub next_resolution { $_[0] }
11
12sub remainder { () }
13
c99dbb05 14sub for_deparse {
15 my ($self) = @_;
6162b001 16 [ word_and_body => [
17 'resolution',
c99dbb05 18 [ pairs => [
19 (@{$self->actions}
20 ? [ actions => [ block => $self->actions ] ]
21 : ()),
22 [ veracity_depends_on => [ block => [
23 map [ statement => [
24 [ symbol => (split '::', ${$_->[0]})[-1] ],
25 [ value_path => [ @{$_}[1..$#$_] ] ],
26 ] ], @{expand_deps($self->veracity_depends_on)}
27 ] ] ],
28 ] ],
29 ] ];
30}
31
9d759b64 321;