| 1 | package I18NFool::Extractor; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 5 | ▶ | use MKDoc::XML::TreeBuilder; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 5 | ▶ | use Locale::PO; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 5 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 5 | our $Namespace = "http://xml.zope.org/namespaces/i18n"; | |||||||||||||||||||||||||||||||||||||||||
| 8 | 5 | our $Prefix = 'i18n'; | |||||||||||||||||||||||||||||||||||||||||
| 9 | 5 | our $Domain = 'default'; | |||||||||||||||||||||||||||||||||||||||||
| 10 | 5 | our $Results = {}; | |||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | sub process | ||||||||||||||||||||||||||||||||||||||||||
| 14 | 6 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
process: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 6 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||
| 16 | 6 | my $data = shift; | |||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | 6 | local $Namespace = $Namespace; | |||||||||||||||||||||||||||||||||||||||||
| 19 | 6 | local $Prefix = $Prefix; | |||||||||||||||||||||||||||||||||||||||||
| 20 | 6 | local $Domain = $Domain; | |||||||||||||||||||||||||||||||||||||||||
| 21 | 6 | local $Results = {}; | |||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | 6 | my @nodes = MKDoc::XML::TreeBuilder->process_data ($data); | |||||||||||||||||||||||||||||||||||||||||
| 24 | 6 | for (@nodes) { $class->_process ($_) } | |||||||||||||||||||||||||||||||||||||||||
| 25 | 6 | return $Results; | |||||||||||||||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | sub _process | ||||||||||||||||||||||||||||||||||||||||||
| 30 | 65 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_process: called CC=28 SCAR=36.5
| |||||||||||||||||||||||||||||||||||||||||||
| 31 | 65 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||
| 32 | 65 | my $tree = shift; | |||||||||||||||||||||||||||||||||||||||||
| 33 | 65 | ▶ | return unless (ref $tree); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | 24 | local $Prefix = $Prefix; | |||||||||||||||||||||||||||||||||||||||||
| 36 | 24 | local $Domain = $Domain; | |||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||
| 38 | # process the I18N namespace | ||||||||||||||||||||||||||||||||||||||||||
| 39 | 24 | foreach my $key (keys %{$tree}) | |||||||||||||||||||||||||||||||||||||||||
| 40 | { | ||||||||||||||||||||||||||||||||||||||||||
| 41 | 133 | my $value = $tree->{$key}; | |||||||||||||||||||||||||||||||||||||||||
| 42 | 133 | ▶ | if ($value eq $Namespace) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 43 | { | ||||||||||||||||||||||||||||||||||||||||||
| 44 | 9 | ▶ | next unless ($key =~ /^xmlns\:/); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 45 | 9 | delete $tree->{$key}; | |||||||||||||||||||||||||||||||||||||||||
| 46 | 9 | $Prefix = $key; | |||||||||||||||||||||||||||||||||||||||||
| 47 | 9 | $Prefix =~ s/^xmlns\://; | |||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | # set the current i18n:domain | ||||||||||||||||||||||||||||||||||||||||||
| 52 | 24 | ▶ | $Domain = delete $tree->{"$Prefix:domain"} || $Domain; | ||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
delete $$tree{"$I18NFool::Extractor::Prefix:domain"} || $I18NFool::Extractor::Domain
MC/DC0%0/2
delete $$tree{"$I18NFool::Extractor::Prefix:domain"} || $I18NFool::Extractor::Domain
delete $$tree{"$I18NFool::Extractor::Prefix:domain"}
$I18NFool::Extractor::Domain
Truth table66%2/3
A || B
A= delete $$tree{"$I18NFool::Extractor::Prefix:domain"}B= $I18NFool::Extractor::Domain
| |||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 24 | my $tag = $tree->{_tag}; | |||||||||||||||||||||||||||||||||||||||||
| 55 | 24 | ▶ | my $attr = { map { /^_/ ? () : ( $_ => $tree->{$_} ) } keys %{$tree} }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 56 | 24 | ▶ | return if ($tag eq '~comment' or $tag eq '~pi' or $tag eq '~declaration'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$tag eq "~comment" or $tag eq "~pi" or $tag eq "~declaration"
$tag eq "~comment" or $tag eq "~pi"
MC/DC0%0/3
$tag eq "~comment" or $tag eq "~pi" or $tag eq "~declaration"
$tag eq "~comment"
$tag eq "~pi"
$tag eq "~declaration"
Truth table25%1/4
A or B or C
A= $tag eq "~comment"B= $tag eq "~pi"C= $tag eq "~declaration"
| |||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||
| 58 | # lookup for attributes... | ||||||||||||||||||||||||||||||||||||||||||
| 59 | 24 | ▶ | $tree->{"$Prefix:attributes"} && do { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 60 | 1 | my $attributes = $tree->{"$Prefix:attributes"}; | |||||||||||||||||||||||||||||||||||||||||
| 61 | 1 | $attributes =~ s/\s*;\s*$//; | |||||||||||||||||||||||||||||||||||||||||
| 62 | 1 | $attributes =~ s/^\s*//; | |||||||||||||||||||||||||||||||||||||||||
| 63 | 1 | my @attributes = split /\s*\;\s*/, $attributes; | |||||||||||||||||||||||||||||||||||||||||
| 64 | 1 | foreach my $attribute (@attributes) | |||||||||||||||||||||||||||||||||||||||||
| 65 | { | ||||||||||||||||||||||||||||||||||||||||||
| 66 | # if we have i18n:attributes="alt alt_text", then the | ||||||||||||||||||||||||||||||||||||||||||
| 67 | # attribute name is 'alt' and the | ||||||||||||||||||||||||||||||||||||||||||
| 68 | # translate_id is 'alt_text' | ||||||||||||||||||||||||||||||||||||||||||
| 69 | 4 | my ($attribute_name, $translate_id); | |||||||||||||||||||||||||||||||||||||||||
| 70 | 4 | ▶ | if ($attribute =~ /\s/) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 71 | { | ||||||||||||||||||||||||||||||||||||||||||
| 72 | 4 | ($attribute_name, $translate_id) = split /\s+/, $attribute, 2; | |||||||||||||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||
| 75 | # otherwise, if we have i18n:attributes="alt", then the | ||||||||||||||||||||||||||||||||||||||||||
| 76 | # attribute name is 'alt' and the | ||||||||||||||||||||||||||||||||||||||||||
| 77 | # translate_id is $tree->{'alt'} | ||||||||||||||||||||||||||||||||||||||||||
| 78 | else | ||||||||||||||||||||||||||||||||||||||||||
| 79 | { | ||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | $attribute_name = $attribute; | |||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | $translate_id = _canonicalize ( $tree->{$attribute_name} ); | |||||||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||
| 84 | 4 | ▶ | $translate_id || next; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 85 | 4 | ▶ | $Results->{$Domain} ||= {}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$I18NFool::Extractor::Results->{$I18NFool::Extractor::Domain} ||= {}
MC/DC100%1/1
$I18NFool::Extractor::Results->{$I18NFool::Extractor::Domain} ||= {}
$I18NFool::Extractor::Results->{$I18NFool::Extractor::Domain}
Truth table100%2/2
A
A= $I18NFool::Extractor::Results->{$I18NFool::Extractor::Domain}
| |||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||
| 87 | 4 | my $existing_po = $Results->{$Domain}->{$translate_id}; | |||||||||||||||||||||||||||||||||||||||||
| 88 | my $new_po = Locale::PO->new ( | ||||||||||||||||||||||||||||||||||||||||||
| 89 | -msgid => $translate_id, | ||||||||||||||||||||||||||||||||||||||||||
| 90 | 4 | ▶ | -msgstr => _canonicalize ( $tree->{$attribute_name} ) || '', | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
_canonicalize($tree->{$attribute_name}) || ''
MC/DC0%0/1
_canonicalize($tree->{$attribute_name}) || ''
_canonicalize($tree->{$attribute_name})
Truth table50%1/2
A
A= _canonicalize($tree->{$attribute_name})
| |||||||||||||||||||||||||||||||||||||||||||
| 91 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||
| 93 | 4 | ▶ | if ($existing_po && ($existing_po->{msgstr} ne $new_po->{msgstr})) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$existing_po and $existing_po->{"msgstr"} ne $new_po->{"msgstr"}
MC/DC0%0/2
$existing_po and $existing_po->{"msgstr"} ne $new_po->{"msgstr"}
$existing_po
$existing_po->{"msgstr"} ne $new_po->{"msgstr"}
Truth table33%1/3
A and B
A= $existing_poB= $existing_po->{"msgstr"} ne $new_po->{"msgstr"}
| |||||||||||||||||||||||||||||||||||||||||||
| 94 | { | ||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | print STDERR "String for '$translate_id' doesn't match:\n". | |||||||||||||||||||||||||||||||||||||||||
| 96 | " old: $existing_po->{msgstr}\n". | ||||||||||||||||||||||||||||||||||||||||||
| 97 | " new: $new_po->{msgstr}\n" | ||||||||||||||||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||
| 100 | 4 | $Results->{$Domain}->{$translate_id} = $new_po; | |||||||||||||||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||||||||||||||||
| 102 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||
| 104 | # lookup for content... | ||||||||||||||||||||||||||||||||||||||||||
| 105 | 24 | ▶ | exists $tree->{"$Prefix:translate"} && do { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 106 | 12 | my ($translate_id); | |||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||
| 108 | # if we have $Domain:translate="something", | ||||||||||||||||||||||||||||||||||||||||||
| 109 | # then the translate_id is 'something' | ||||||||||||||||||||||||||||||||||||||||||
| 110 | 12 | ▶ | if (defined $tree->{"$Prefix:translate"} and $tree->{"$Prefix:translate"} ne '') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $$tree{"$I18NFool::Extractor::Prefix:translate"} and $$tree{"$I18NFool::Extractor::Prefix:translate"} ne ""
MC/DC0%0/2
defined $$tree{"$I18NFool::Extractor::Prefix:translate"} and $$tree{"$I18NFool::Extractor::Prefix:translate"} ne ""
defined $$tree{"$I18NFool::Extractor::Prefix:translate"}
$$tree{"$I18NFool::Extractor::Prefix:translate"} ne ""
Truth table33%1/3
A and B
A= defined $$tree{"$I18NFool::Extractor::Prefix:translate"}B= $$tree{"$I18NFool::Extractor::Prefix:translate"} ne ""
| |||||||||||||||||||||||||||||||||||||||||||
| 111 | { | ||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | $translate_id = $tree->{"$Prefix:translate"}; | |||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||
| 115 | # otherwise, the translate_id has to be computed | ||||||||||||||||||||||||||||||||||||||||||
| 116 | # from the contents of this node, so that | ||||||||||||||||||||||||||||||||||||||||||
| 117 | # <div i18n:translate="">Hello, <span i18n:name="user">David</span>, how are you?</div> | ||||||||||||||||||||||||||||||||||||||||||
| 118 | # becomes 'Hello, ${user}, how are you?' | ||||||||||||||||||||||||||||||||||||||||||
| 119 | else | ||||||||||||||||||||||||||||||||||||||||||
| 120 | { | ||||||||||||||||||||||||||||||||||||||||||
| 121 | 12 | $translate_id = _canonicalize ( _extract_content_string ($tree) ); | |||||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||
| 124 | 12 | ▶ | $translate_id || next; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 125 | 12 | ▶ | $Results->{$Domain} ||= {}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$I18NFool::Extractor::Results->{$I18NFool::Extractor::Domain} ||= {}
MC/DC100%1/1
$I18NFool::Extractor::Results->{$I18NFool::Extractor::Domain} ||= {}
$I18NFool::Extractor::Results->{$I18NFool::Extractor::Domain}
Truth table100%2/2
A
A= $I18NFool::Extractor::Results->{$I18NFool::Extractor::Domain}
| |||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||
| 127 | 12 | my $existing_po = $Results->{$Domain}->{$translate_id}; | |||||||||||||||||||||||||||||||||||||||||
| 128 | 12 | ▶ | my $new_po = Locale::PO->new ( | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
_canonicalize(_extract_content_string($tree)) || ''
MC/DC0%0/1
_canonicalize(_extract_content_string($tree)) || ''
_canonicalize(_extract_content_string($tree))
Truth table50%1/2
A
A= _canonicalize(_extract_content_string($tree))
| |||||||||||||||||||||||||||||||||||||||||||
| 129 | -msgid => $translate_id, | ||||||||||||||||||||||||||||||||||||||||||
| 130 | -msgstr => _canonicalize ( _extract_content_string ($tree) ) || '', | ||||||||||||||||||||||||||||||||||||||||||
| 131 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||
| 133 | 12 | ▶ | if ($existing_po && ($existing_po->{msgstr} ne $new_po->{msgstr})) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$existing_po and $existing_po->{"msgstr"} ne $new_po->{"msgstr"}
MC/DC0%0/2
$existing_po and $existing_po->{"msgstr"} ne $new_po->{"msgstr"}
$existing_po
$existing_po->{"msgstr"} ne $new_po->{"msgstr"}
Truth table33%1/3
A and B
A= $existing_poB= $existing_po->{"msgstr"} ne $new_po->{"msgstr"}
| |||||||||||||||||||||||||||||||||||||||||||
| 134 | { | ||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | print STDERR "String for '$translate_id' doesn't match:\n". | |||||||||||||||||||||||||||||||||||||||||
| 136 | " old: $existing_po->{msgstr}\n". | ||||||||||||||||||||||||||||||||||||||||||
| 137 | " new: $new_po->{msgstr}\n" | ||||||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||
| 140 | 12 | $Results->{$Domain}->{$translate_id} = $new_po; | |||||||||||||||||||||||||||||||||||||||||
| 141 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||
| 143 | # I know, I know, the I18N namespace processing is a bit broken... | ||||||||||||||||||||||||||||||||||||||||||
| 144 | # It should suffice for now | ||||||||||||||||||||||||||||||||||||||||||
| 145 | 24 | delete $tree->{"$Prefix:attributes"}; | |||||||||||||||||||||||||||||||||||||||||
| 146 | 24 | delete $tree->{"$Prefix:translate"}; | |||||||||||||||||||||||||||||||||||||||||
| 147 | 24 | delete $tree->{"$Prefix:name"}; | |||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||
| 149 | # Do the same i18n thing with child nodes, recursively. | ||||||||||||||||||||||||||||||||||||||||||
| 150 | # for some reason it always makes me think of roller coasters. | ||||||||||||||||||||||||||||||||||||||||||
| 151 | # Yeeeeeeee! | ||||||||||||||||||||||||||||||||||||||||||
| 152 | 24 | ▶ | defined $tree->{_content} and do { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 153 | 23 | for (@{$tree->{_content}}) { $class->_process ($_) } | |||||||||||||||||||||||||||||||||||||||||
| 154 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||
| 158 | sub _canonicalize | ||||||||||||||||||||||||||||||||||||||||||
| 159 | 28 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_canonicalize: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||||||||||||||||
| 160 | 28 | ▶ | my $string = shift || ''; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
shift() || ''
MC/DC0%0/1
shift() || ''
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||||||||||
| 161 | 28 | $string =~ s/\r/ /g; | |||||||||||||||||||||||||||||||||||||||||
| 162 | 28 | $string =~ s/\n/ /g; | |||||||||||||||||||||||||||||||||||||||||
| 163 | 28 | $string =~ s/\s+/ /gsm; | |||||||||||||||||||||||||||||||||||||||||
| 164 | 28 | $string =~ s/^ //; | |||||||||||||||||||||||||||||||||||||||||
| 165 | 28 | $string =~ s/ $//; | |||||||||||||||||||||||||||||||||||||||||
| 166 | 28 | return $string; | |||||||||||||||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||
| 170 | sub _extract_content_string | ||||||||||||||||||||||||||||||||||||||||||
| 171 | 24 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_extract_content_string: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||
| 172 | 24 | my $tree = shift; | |||||||||||||||||||||||||||||||||||||||||
| 173 | 24 | my @res = (); | |||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||
| 175 | 24 | my $count = 0; | |||||||||||||||||||||||||||||||||||||||||
| 176 | 24 | foreach my $node (@{$tree->{_content}}) | |||||||||||||||||||||||||||||||||||||||||
| 177 | { | ||||||||||||||||||||||||||||||||||||||||||
| 178 | 28 | ▶ | ref $node or do { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 179 | 26 | push @res, $node; | |||||||||||||||||||||||||||||||||||||||||
| 180 | 26 | next; | |||||||||||||||||||||||||||||||||||||||||
| 181 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||
| 183 | 2 | $count++; | |||||||||||||||||||||||||||||||||||||||||
| 184 | 2 | ▶ | my $name = $node->{"$Prefix:name"} || $count; | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$$node{"$I18NFool::Extractor::Prefix:name"} || $count
MC/DC0%0/2
$$node{"$I18NFool::Extractor::Prefix:name"} || $count
$$node{"$I18NFool::Extractor::Prefix:name"}
$count
Truth table33%1/3
A || B
A= $$node{"$I18NFool::Extractor::Prefix:name"}B= $count
| |||||||||||||||||||||||||||||||||||||||||||
| 185 | 2 | push @res, '${' . $name . '}'; | |||||||||||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||
| 188 | 24 | return join '', @res; | |||||||||||||||||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||
| 192 | 5 | 1; | |||||||||||||||||||||||||||||||||||||||||