| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# Copyrights 2007-2018 by [Mark Overmeer ]. |
|
2
|
|
|
|
|
|
|
# For other contributors see ChangeLog. |
|
3
|
|
|
|
|
|
|
# See the manual pages for details on the licensing terms. |
|
4
|
|
|
|
|
|
|
# Pod stripped from pm file by OODoc 2.02. |
|
5
|
|
|
|
|
|
|
# This code is part of distribution Log-Report-Lexicon. Meta-POD processed |
|
6
|
|
|
|
|
|
|
# with OODoc into POD and HTML manual-pages. See README.md |
|
7
|
|
|
|
|
|
|
# Copyright Mark Overmeer. Licensed under the same terms as Perl itself. |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Log::Report::Lexicon::Table; |
|
10
|
6
|
|
|
6
|
|
37
|
use vars '$VERSION'; |
|
|
6
|
|
|
|
|
15
|
|
|
|
6
|
|
|
|
|
240
|
|
|
11
|
|
|
|
|
|
|
$VERSION = '1.11'; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
6
|
|
|
6
|
|
27
|
use warnings; |
|
|
6
|
|
|
|
|
8
|
|
|
|
6
|
|
|
|
|
128
|
|
|
15
|
6
|
|
|
6
|
|
42
|
use strict; |
|
|
6
|
|
|
|
|
11
|
|
|
|
6
|
|
|
|
|
128
|
|
|
16
|
|
|
|
|
|
|
|
|
17
|
6
|
|
|
6
|
|
426
|
use Log::Report 'log-report-lexicon'; |
|
|
6
|
|
|
|
|
87737
|
|
|
|
6
|
|
|
|
|
25
|
|
|
18
|
|
|
|
|
|
|
|
|
19
|
6
|
|
|
6
|
|
1357
|
use POSIX qw/strftime/; |
|
|
6
|
|
|
|
|
10
|
|
|
|
6
|
|
|
|
|
44
|
|
|
20
|
6
|
|
|
6
|
|
360
|
use IO::File (); |
|
|
6
|
|
|
|
|
37
|
|
|
|
6
|
|
|
|
|
118
|
|
|
21
|
6
|
|
|
6
|
|
40
|
use List::Util qw/sum/; |
|
|
6
|
|
|
|
|
9
|
|
|
|
6
|
|
|
|
|
2580
|
|
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
|
24
|
2
|
|
|
2
|
1
|
304
|
sub new(@) { my $class = shift; (bless {}, $class)->init({@_}) } |
|
|
2
|
|
|
|
|
15
|
|
|
25
|
0
|
|
|
0
|
0
|
0
|
sub init($) {shift} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
#----------------------- |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
#----------------------- |
|
30
|
|
|
|
|
|
|
|
|
31
|
0
|
|
|
0
|
1
|
0
|
sub msgid($;$) {panic "not implemented"} |
|
32
|
0
|
|
|
0
|
1
|
0
|
sub msgstr($;$$) {panic "not implemented"} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
#------------------ |
|
35
|
|
|
|
|
|
|
|
|
36
|
0
|
|
|
0
|
1
|
0
|
sub add($) {panic "not implemented"} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
|
39
|
0
|
|
|
0
|
1
|
0
|
sub translations(;$) {panic "not implemented"} |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub pluralIndex($) |
|
43
|
23
|
|
|
23
|
1
|
37
|
{ my ($self, $count) = @_; |
|
44
|
|
|
|
|
|
|
my $algo = $self->{algo} |
|
45
|
23
|
50
|
|
|
|
40
|
or error __x"there is no Plural-Forms field in the header, but needed"; |
|
46
|
|
|
|
|
|
|
|
|
47
|
23
|
|
|
|
|
383
|
$algo->($count); |
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub setupPluralAlgorithm() |
|
52
|
18
|
|
|
18
|
1
|
22
|
{ my $self = shift; |
|
53
|
18
|
100
|
|
|
|
32
|
my $forms = $self->header('Plural-Forms') or return; |
|
54
|
|
|
|
|
|
|
|
|
55
|
7
|
50
|
|
|
|
75
|
my $alg = $forms =~ m/plural\=([n%!=><\s\d|&?:()]+)/ ? $1 : "n!=1"; |
|
56
|
7
|
|
|
|
|
46
|
$alg =~ s/\bn\b/(\$_[0])/g; |
|
57
|
7
|
|
|
|
|
459
|
my $code = eval "sub(\$) {$alg}"; |
|
58
|
7
|
50
|
|
|
|
49
|
$@ and error __x"invalid plural-form algorithm '{alg}'", alg => $alg; |
|
59
|
7
|
|
|
|
|
18
|
$self->{algo} = $code; |
|
60
|
|
|
|
|
|
|
|
|
61
|
7
|
50
|
|
|
|
48
|
$self->{nplurals} = $forms =~ m/\bnplurals\=(\d+)/ ? $1 : 2; |
|
62
|
7
|
|
|
|
|
17
|
$self; |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
|
66
|
8
|
|
|
8
|
1
|
31
|
sub nrPlurals() {shift->{nplurals}} |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub header($@) |
|
70
|
14
|
|
|
14
|
1
|
571
|
{ my ($self, $field) = @_; |
|
71
|
14
|
50
|
|
|
|
35
|
my $header = $self->msgid('') or return; |
|
72
|
14
|
100
|
|
|
|
251
|
$header =~ m/^\Q$field\E\:\s*([^\n]*?)\;?\s*$/im ? $1 : undef; |
|
73
|
|
|
|
|
|
|
} |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |