Permalink
Browse files

[logos] Add a 'perl' dump option, which uses Data::Dumper instead of …

…YAML::Syck.

From: Dustin L. Howett <dustin@howett.net>

git-svn-id: http://svn.howett.net/svn/theos/trunk@507 4410221e-0ddf-4ce3-99c0-2db6c0dbc727
  • Loading branch information...
1 parent cc4e414 commit 133cab4e172f21f32cd93135c5992f746b0ec66b @DHowett DHowett committed Mar 1, 2012
Showing with 21 additions and 9 deletions.
  1. +21 −9 bin/logos.pl
View
@@ -585,15 +585,27 @@ package main;
my @sortedPatches = sort { ($b->line == $a->line ? ($b->start || -1) <=> ($a->start || -1) : $b->line <=> $a->line) } @patches;
-if(exists $main::CONFIG{"dump"} && $main::CONFIG{"dump"} eq "yaml") {
- print STDERR YAML::Syck::Dump({
- linemap=>\%lineMapping,
- depthmap=>\%depthMapping,
- groups=>\@groups,
- patches=>\@patches,
- lines=>\@lines,
- config=>\%::CONFIG
- });
+if(exists $main::CONFIG{"dump"}) {
+ my $dumphref = {
+ linemap=>\%lineMapping,
+ depthmap=>\%depthMapping,
+ groups=>\@groups,
+ patches=>\@patches,
+ lines=>\@lines,
+ config=>\%::CONFIG
+ };
+ if($main::CONFIG{"dump"} eq "yaml") {
+ load 'YAML::Syck';
+ print STDERR YAML::Syck::Dump($dumphref);
+ } elsif($main::CONFIG{"dump"} eq "perl") {
+ load 'Data::Dumper';
+ $Data::Dumper::Purity = 1;
+
+ my @k; my @v;
+ map {push(@k,$_); push(@v, $dumphref->{$_});} keys %$dumphref;
+ print STDERR Data::Dumper->Dump(\@v, \@k);
+ }
+ #print STDERR Data::Dumper->Dump([\@groups, \@patches, \@lines, \%::CONFIG], [qw(groups patches lines config)]);
}
if($main::warnings > 0 && exists $main::CONFIG{"warnings"} && $main::CONFIG{"warnings"} eq "error") {

0 comments on commit 133cab4

Please sign in to comment.