line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::Karmasphere::Parser::Simple::List; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
1162
|
use strict; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
186
|
|
4
|
5
|
|
|
5
|
|
26
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
132
|
|
5
|
5
|
|
|
5
|
|
25
|
use base 'Mail::Karmasphere::Parser::Base'; |
|
5
|
|
|
|
|
53
|
|
|
5
|
|
|
|
|
3155
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
4
|
|
|
4
|
0
|
2496
|
my $class = shift; |
9
|
|
|
|
|
|
|
# print STDERR "new: \$class = $class\n"; |
10
|
|
|
|
|
|
|
# print STDERR "new: \$class->_streams() = @{[$class->_streams()]}\n";; |
11
|
4
|
50
|
|
|
|
25
|
my $self = ($#_ == 0) ? { %{ (shift) } } : { @_ }; |
|
0
|
|
|
|
|
0
|
|
12
|
4
|
50
|
|
|
|
22
|
unless (exists $self->{Streams}) { |
13
|
4
|
50
|
|
|
|
35
|
$self->{Type} = $class->_type() unless $self->{Type}; |
14
|
4
|
|
|
|
|
17
|
$self->{Streams} = [ $class->_streams() ]; |
15
|
|
|
|
|
|
|
} |
16
|
4
|
|
|
|
|
35
|
$self = $class->SUPER::new($self); |
17
|
4
|
50
|
|
|
|
42
|
$self->{Value} = 1000 unless exists $self->{Value}; |
18
|
4
|
|
|
|
|
10
|
return $self; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub _parse { |
22
|
35
|
|
|
35
|
|
40
|
my $self = shift; |
23
|
35
|
|
|
|
|
37
|
for (;;) { |
24
|
35
|
|
|
|
|
91
|
my $line = $self->fh->getline; |
25
|
35
|
100
|
|
|
|
7001
|
return undef unless $line; |
26
|
31
|
50
|
|
|
|
135
|
next if $line =~ /^#/; |
27
|
31
|
50
|
|
|
|
104
|
next unless $line =~ /\S/; |
28
|
31
|
|
|
|
|
82
|
chomp($line); $line =~ s/\r$//g; # strip trailing CRLF |
|
31
|
|
|
|
|
75
|
|
29
|
31
|
|
|
|
|
100
|
$line =~ s/[\s;].+$//; |
30
|
31
|
|
|
|
|
156
|
return new Mail::Karmasphere::Parser::Record( |
31
|
|
|
|
|
|
|
s => 0, |
32
|
|
|
|
|
|
|
i => $line, |
33
|
|
|
|
|
|
|
v => $self->{Value}, |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
0
|
|
|
sub _type { "Parser::Simple::* subclass must define _type()" } |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |