line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::XPathScript::Template::Tag; |
2
|
|
|
|
|
|
|
|
3
|
24
|
|
|
24
|
|
169
|
use strict; |
|
24
|
|
|
|
|
45
|
|
|
24
|
|
|
|
|
1031
|
|
4
|
24
|
|
|
24
|
|
132
|
use warnings; |
|
24
|
|
|
|
|
44
|
|
|
24
|
|
|
|
|
686
|
|
5
|
|
|
|
|
|
|
|
6
|
24
|
|
|
24
|
|
125
|
use Carp; |
|
24
|
|
|
|
|
43
|
|
|
24
|
|
|
|
|
1566
|
|
7
|
24
|
|
|
24
|
|
146
|
use Scalar::Util qw/ reftype /; |
|
24
|
|
|
|
|
63
|
|
|
24
|
|
|
|
|
1700
|
|
8
|
|
|
|
|
|
|
|
9
|
24
|
|
|
|
|
198
|
use overload '&{}' => \&_overload_func, |
10
|
24
|
|
|
24
|
|
118
|
q{""} => \&_overload_quote; |
|
24
|
|
|
|
|
53
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '1.54'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our @ALLOWED_ATTRIBUTES = qw{ |
15
|
|
|
|
|
|
|
pre post |
16
|
|
|
|
|
|
|
intro extro |
17
|
|
|
|
|
|
|
prechildren postchildren |
18
|
|
|
|
|
|
|
prechild testcode |
19
|
|
|
|
|
|
|
showtag |
20
|
|
|
|
|
|
|
postchild |
21
|
|
|
|
|
|
|
action |
22
|
|
|
|
|
|
|
rename |
23
|
|
|
|
|
|
|
content contents |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub new { |
27
|
10
|
|
|
10
|
1
|
182
|
return bless {}, shift; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub get { |
31
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
32
|
0
|
0
|
|
|
|
0
|
return wantarray ? map { $self->{$_} } @_ |
|
0
|
|
|
|
|
0
|
|
33
|
|
|
|
|
|
|
: $self->{$_[0]} |
34
|
|
|
|
|
|
|
; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub set { |
38
|
15
|
|
|
15
|
1
|
27
|
my( $self, $attribute_ref ) = @_; |
39
|
|
|
|
|
|
|
|
40
|
15
|
|
|
|
|
20
|
for my $key ( keys %{$attribute_ref} ) { |
|
15
|
|
|
|
|
47
|
|
41
|
252
|
|
|
|
|
442
|
croak "attribute $key not allowed" |
42
|
18
|
50
|
|
|
|
34
|
if ! grep { $key eq $_ } @ALLOWED_ATTRIBUTES; |
43
|
|
|
|
|
|
|
|
44
|
18
|
|
|
|
|
49
|
$self->{$key} = $attribute_ref->{$key}; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# renaming implies showing the tag |
47
|
18
|
50
|
|
|
|
59
|
$self->{showtag} = 1 if $key eq 'rename'; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
15
|
|
|
|
|
59
|
return; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub _overload_func { |
54
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
55
|
0
|
|
|
0
|
|
0
|
return sub { $self->set( @_ ) } |
56
|
0
|
|
|
|
|
0
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub _overload_quote { |
59
|
25
|
|
|
25
|
|
37
|
my $self = shift; |
60
|
25
|
|
|
|
|
99
|
return $self; |
61
|
0
|
|
|
0
|
|
|
return sub { print $self }; |
|
0
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
'end of XML::XPathScript::Template::Tag'; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
__END__ |