X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDX%2FUtils.pm;h=2bef078c58c31da30fc22e7302f74889cc781d03;hb=4db57c0455eccf4cb7ac0b89abdc1969add73685;hp=b52119dbaf6bb28f9b1385e3193aca71ad06650b;hpb=b63c427e5f7bf56fce5308a970a7402a4d62e0d4;p=scpubgit%2FDX.git diff --git a/lib/DX/Utils.pm b/lib/DX/Utils.pm index b52119d..2bef078 100644 --- a/lib/DX/Utils.pm +++ b/lib/DX/Utils.pm @@ -11,7 +11,7 @@ my @const = ( our @EXPORT_OK = ( @const, (my @builders = qw(rspace rstrat res string number dict proposition)), - 'deparse', '*trace', 'expand_deps', + 'deparse', '*trace', 'expand_deps', 'format_deps', ); our %EXPORT_TAGS = ( @@ -56,6 +56,15 @@ sub expand_deps { [ map _expand_dep($_), @{$_[0]} ] } +sub format_deps { + [ block => [ + map [ statement => [ + [ symbol => (split '::', ${$_->[0]})[-1] ], + [ value_path => [ @{$_}[1..$#$_] ] ] + ] ], @{$_[0]} + ] ] +} + sub rspace { require DX::ResolutionSpace; DX::ResolutionSpace->new(@_);