rspace tracing
[scpubgit/DX.git] / lib / DX / Step / ResolveProposition.pm
index 42b92dc..3969867 100644 (file)
@@ -4,6 +4,7 @@ use DX::Step::EnterRecheck;
 use DX::Step::Backtrack;
 
 use Types::Standard qw(ArrayRef);
+use DX::Utils qw(expand_deps);
 
 use DX::Class;
 
@@ -28,15 +29,7 @@ has actions => (is => 'lazy', init_arg => undef, builder => sub {
 
 has depends_on => (is => 'lazy', init_arg => undef, builder => sub {
   my ($self) = @_;
-  my $_expand_dep = sub {
-    my ($type, @path) = @{$_[0]};
-    my @expanded = map {
-      ref() ? @{$_->value_path or return ()} : $_
-    } @path;
-    return [ $type, @expanded ];
-  };
-  [ map $_expand_dep->($_),
-      @{$self->current_resolution->veracity_depends_on} ];
+  expand_deps($self->current_resolution->veracity_depends_on);
 });
 
 has alternative_step => (is => 'lazy', init_arg => undef, builder => sub {
@@ -68,7 +61,7 @@ sub apply_to {
       (@{$self->actions}
         ? [ statement => [
             [ symbol => 'actions' ],
-            [ block => [ @{$self->actions} ] ],
+            [ block => $self->actions ],
           ] ]
         : ()),
       [ statement => [