line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pod::Simple::PullParserStartToken; |
2
|
10
|
|
|
10
|
|
66
|
use strict; |
|
10
|
|
|
|
|
30
|
|
|
10
|
|
|
|
|
290
|
|
3
|
10
|
|
|
10
|
|
48
|
use warnings; |
|
10
|
|
|
|
|
34
|
|
|
10
|
|
|
|
|
258
|
|
4
|
10
|
|
|
10
|
|
4713
|
use Pod::Simple::PullParserToken (); |
|
10
|
|
|
|
|
24
|
|
|
10
|
|
|
|
|
2800
|
|
5
|
|
|
|
|
|
|
our @ISA = ('Pod::Simple::PullParserToken'); |
6
|
|
|
|
|
|
|
our $VERSION = '3.45'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { # Class->new(tagname, optional_attrhash); |
9
|
346
|
|
|
346
|
0
|
639
|
my $class = shift; |
10
|
346
|
|
33
|
|
|
1761
|
return bless ['start', @_], ref($class) || $class; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# Purely accessors: |
14
|
|
|
|
|
|
|
|
15
|
471
|
50
|
|
471
|
1
|
2807
|
sub tagname { (@_ == 2) ? ($_[0][1] = $_[1]) : $_[0][1] } |
16
|
3
|
|
|
3
|
1
|
15
|
sub tag { shift->tagname(@_) } |
17
|
|
|
|
|
|
|
|
18
|
2
|
|
|
2
|
1
|
8
|
sub is_tagname { $_[0][1] eq $_[1] } |
19
|
0
|
|
|
0
|
1
|
0
|
sub is_tag { shift->is_tagname(@_) } |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
0
|
|
0
|
0
|
1
|
0
|
sub attr_hash { $_[0][2] ||= {} } |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub attr { |
25
|
82
|
50
|
|
82
|
1
|
185
|
if(@_ == 2) { # Reading: $token->attr('attrname') |
|
|
0
|
|
|
|
|
|
26
|
82
|
50
|
|
|
|
103
|
${$_[0][2] || return undef}{ $_[1] }; |
|
82
|
|
|
|
|
272
|
|
27
|
|
|
|
|
|
|
} elsif(@_ > 2) { # Writing: $token->attr('attrname', 'newval') |
28
|
0
|
|
0
|
|
|
|
${$_[0][2] ||= {}}{ $_[1] } = $_[2]; |
|
0
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
} else { |
30
|
0
|
|
|
|
|
|
require Carp; |
31
|
0
|
|
|
|
|
|
Carp::croak( |
32
|
|
|
|
|
|
|
'usage: $object->attr("val") or $object->attr("key", "newval")'); |
33
|
0
|
|
|
|
|
|
return undef; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |