line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::Grammar::Fiction::FromProto::Node::Element; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
59
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
47
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
9
|
use MooX 'late'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
11
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.14.10'; |
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__ |