line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::Grammar::Fiction::FromProto::Node::Element; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
8
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
59
|
|
4
|
2
|
|
|
2
|
|
19
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
43
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
6
|
use MooX 'late'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
9
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.14.11'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
extends("XML::Grammar::Fiction::FromProto::Node::WithContent"); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has 'name' => (isa => 'Str', is => 'rw'); |
14
|
|
|
|
|
|
|
has 'attrs' => (isa => 'ArrayRef', is => 'rw'); |
15
|
|
|
|
|
|
|
has 'open_line' => (isa => 'Maybe[Int]', is => 'rw'); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub lookup_attr |
19
|
|
|
|
|
|
|
{ |
20
|
0
|
|
|
0
|
1
|
|
my ($self, $attr_name) = @_; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
0
|
|
|
my $pair = List::Util::first { $_->{key} eq $attr_name } (@{$self->attrs()}); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
0
|
0
|
|
|
|
|
if (!defined($pair)) |
25
|
|
|
|
|
|
|
{ |
26
|
0
|
|
|
|
|
|
return undef; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
else |
29
|
|
|
|
|
|
|
{ |
30
|
0
|
|
|
|
|
|
return $pair->{value}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |