Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | # NOTE: Derived from blib/lib/Inline/denter.pm. |
2 | # Changes made here will be lost when autosplit is run again. | |
3 | # See AutoSplit.pm. | |
4 | package Inline::denter; | |
5 | ||
6 | #line 265 "blib/lib/Inline/denter.pm (autosplit into blib/lib/auto/Inline/denter/indent_hash.al)" | |
7 | sub indent_hash { | |
8 | my ($o, $data) = @_; | |
9 | my $stream = $o->_print_ref($data, '%', 'HASH'); | |
10 | return $$stream if ref $stream; | |
11 | my $indent = ++$o->{level} * $o->{width}; | |
12 | for my $key (sort keys %$data) { | |
13 | my $key_out = $key; | |
14 | if ($key =~ /\n/ or | |
15 | $key =~ /\Q$o->{comma}\E/) { | |
16 | my $marker = 'EOK'; | |
17 | $marker++ while $key =~ /^$marker$/m; | |
18 | my $chomp = (($o->{key} = $key) =~ s/\n\Z//m) ? '' : '-'; | |
19 | $o->{key} .= "\n$marker\n"; | |
20 | $key_out = "<<$marker$chomp"; | |
21 | } | |
22 | elsif ($data =~ /^[\s\%\@\$\\?\"]|\s$/) { | |
23 | $key_out = qq{"$key"}; | |
24 | } | |
25 | $stream .= ' ' x $indent . $key_out . $o->{comma}; | |
26 | $stream .= $o->indent_data($data->{$key}); | |
27 | } | |
28 | $o->{level}--; | |
29 | return $stream; | |
30 | } | |
31 | ||
32 | # end of Inline::denter::indent_hash | |
33 | 1; |