less terrible deparsing for BindValue
Matt S Trout [Mon, 7 Mar 2016 22:23:53 +0000 (22:23 +0000)]
lib/DX/Deparse.pm

index 541a5a5..8edfffd 100644 (file)
@@ -112,7 +112,14 @@ sub _fmt_action_addvalue {
 
 sub _fmt_action_bindvalue {
   my ($self, $action, $meta) = @_;
-  $self->_fmt_action_generic(BindValue => $action, $meta);
+  my $path = join '.', map $self->_fmt($_, $meta), @{$action->target_path};
+  my $bound_path = join '.',
+                     map $self->_fmt($_, $meta),
+                       @{$action->new_value
+                                ->action_builder
+                                ->inner_action_builder
+                                ->target_path};
+  join ' ', BindValue => $path, $bound_path;
 }
 
 sub _fmt_action_setboundvalue {