line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::TreeDumper::Renderer::ASCII; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6822
|
use 5.006; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
36
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
370
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require Exporter; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our @EXPORT = qw(); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#------------------------------------------------------------------------------------------- |
20
|
|
|
|
|
|
|
sub GetRenderer |
21
|
|
|
|
|
|
|
{ |
22
|
|
|
|
|
|
|
# setup arguments can be passed to the renderer |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
return |
25
|
|
|
|
|
|
|
( |
26
|
|
|
|
|
|
|
{ |
27
|
0
|
|
|
0
|
|
|
BEGIN => sub{"$_[0]\n"} |
28
|
0
|
|
|
0
|
|
|
, NODE => \&RenderAsciiNode |
29
|
|
|
|
|
|
|
, END => sub{''} |
30
|
|
|
|
|
|
|
} |
31
|
0
|
|
|
0
|
0
|
|
) ; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
#------------------------------------------------------------------------------------------- |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub RenderAsciiNode |
38
|
|
|
|
|
|
|
{ |
39
|
|
|
|
|
|
|
# a simple proof of concept, no config is handled |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my |
42
|
|
|
|
|
|
|
( |
43
|
0
|
|
|
0
|
0
|
|
$element |
44
|
|
|
|
|
|
|
, $level |
45
|
|
|
|
|
|
|
, $is_terminal |
46
|
|
|
|
|
|
|
, $previous_level_separator |
47
|
|
|
|
|
|
|
, $separator |
48
|
|
|
|
|
|
|
, $element_name |
49
|
|
|
|
|
|
|
, $element_value |
50
|
|
|
|
|
|
|
, $td_address |
51
|
|
|
|
|
|
|
, $address_link |
52
|
|
|
|
|
|
|
, $perl_size |
53
|
|
|
|
|
|
|
, $perl_address |
54
|
|
|
|
|
|
|
, $setup |
55
|
|
|
|
|
|
|
) = @_ ; |
56
|
|
|
|
|
|
|
|
57
|
0
|
0
|
|
|
|
|
$element_value = " = $element_value" if($element_value ne '') ; |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
my $address = $td_address ; |
60
|
0
|
0
|
|
|
|
|
$address .= "-> $address_link" if defined $address_link ; |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
my $perl_data = '' ; |
63
|
0
|
0
|
|
|
|
|
$perl_data .= "<$perl_size> " if $perl_size ne '' ; |
64
|
0
|
0
|
|
|
|
|
$perl_data .= "$perl_address " if $perl_address ne '' ; |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
"$previous_level_separator$separator $element_name$element_value [$address] $perl_data\n" ; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
#------------------------------------------------------------------------------------------- |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1 ; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |