rspace tracing
[scpubgit/DX.git] / lib / DX / Resolution.pm
index 9e67d4d..3606633 100644 (file)
@@ -1,5 +1,6 @@
 package DX::Resolution;
 
+use DX::Utils qw(expand_deps);
 use DX::Class;
 
 has veracity_depends_on => (is => 'ro', required => 1);
@@ -10,4 +11,22 @@ sub next_resolution { $_[0] }
 
 sub remainder { () }
 
+sub for_deparse {
+  my ($self) = @_;
+  [ statement => [
+    [ symbol => 'resolution' ],
+    [ pairs => [
+      (@{$self->actions}
+        ? [ actions => [ block => $self->actions ] ]
+        : ()),
+      [ veracity_depends_on => [ block => [
+        map [ statement => [
+          [ symbol => (split '::', ${$_->[0]})[-1] ],
+          [ value_path => [ @{$_}[1..$#$_] ] ],
+        ] ], @{expand_deps($self->veracity_depends_on)}
+      ] ] ],
+    ] ],
+  ] ];
+}
+
 1;