blib/lib/Lingua/Romana/Perligata.pm

filter: Statementstmt 62.7% 425 / 677 Branchbran 44.1% 205 / 464 Conditioncond 51.9% 94 / 181 MC/DCmcdc 21.4% 21 / 98 Subroutinesub 63.7% 44 / 69 Podpod 5.2% 1 / 19 totaltotal 52.3% 790 / 1508 CC 302 SCAR 71.6
CC
302
Cov
55%
tokenize
4153.7
command
367.5
translate
88.3
CRAP 1289.0
↑ Summary
1 package Lingua::Romana::Perligata;
2  
3 3 our $VERSION = '0.604';
4  
5 3 ▶use Filter::Util::Call;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use IO::Handle;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use Data::Dumper 'Dumper';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶no warnings 'once';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 3 my $offset = 0;
11 3 my $translate = 0;
12 3 my $debug = 0;
13  
14 sub import {
15 3 ▶ filter_add({});
Subroutine import: called CC=1 SCAR=0.0
16 3 $offset = (caller)[2]+1;
17 3 $translate = grep /^converte?$/i, @_[1..$#_];
18 3 $debug = grep /^investiga?$/i, @_[1..$#_];
19 3 $lex = grep /^discribe?$/i, @_[1..$#_];
20 3 1;
21 }
22  
23 3 $translator = q{
24 BEGIN {
25 $SIG{__DIE__} = sub { die Lingua::Romana::Perligata::readversum($_[0]) };
26 $SIG{__WARN__} = sub { return if $_[0] =~ /(...) interpreted as function/;
27 warn Lingua::Romana::Perligata::readversum($_[0]) };
28 }
29 };
30  
31 0 ▶sub unimport { filter_del() }
Subroutine unimport: not called CC=1 SCAR=6.9
32  
33 sub filter {
34 6 ▶ my($self) = @_ ;
Subroutine filter: called CC=7 SCAR=21.4
Pod undocumented
35  
36 6 my $status = 1;
37 6 $status = filter_read(100_000);
38 6 ▶ return $status if $status<0;
Branch: 1 branch
BranchTrueFalseTotal
if $status < 0 0 6 6
39 6 s/\A#!.*\n//;
40 6 s{^ \h* ecce \b .*? (?: ^ \h* ecce \h+ seco \h* $ | \Z )}{}gxmsi;
41 6 $tokens = tokenize($_);
42  
43 6 my @commands;
44 6 ▶ push @commands, conn_command($tokens,'END') while @$tokens;
Branch: 1 branch
BranchTrueFalseTotal
@$tokens and do { push @commands, conn_command($tokens, "END") } 11 6 17
45 6 $_ = join ";\n", map { $_->translate } @commands;
46  
47 6 ▶ if ($translate) { print "$_;\n" and exit }
Branch: 3 branches
BranchTrueFalseTotal
if ($translate) { } 0 6 6
elsif ($debug and /\S/) { } 0 12 12
print "$_;\n" and exit 0 0 0
48 ▶ elsif ($debug && /\S/) {
Condition33%1/3
$debug and /\S/
!ll&&!rl&&r
600
MC/DC0%0/2
$debug and /\S/
$debug /\S/
Truth table33%1/3
A and B
A= $debugB= /\S/
ABresult
0X0
100
111
49 0 print "=" x 72,
50 "\nTranslated to:\n\n$_\n",
51 "=" x 72;
52 }
53 6 $_ = "$translator\n#line $offset\n;$_";
54 6 return $status;
55 }
56  
57 #==========TOKENIZER============
58  
59 0 ▶sub adversum { " ad versum " . to_rn($_[0]->{line}) . "\n" }
Subroutine adversum: not called CC=1 SCAR=6.9
Pod undocumented
60 0 ▶sub readversum { $_[0] =~ m{(.*)at\s+(\S+)\s+line\s+(\d+)(.*)}s or return $_[0];
Subroutine readversum: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
$_[0] =~ /(.*)at\s+(\S+)\s+line\s+(\d+)(.*)/s or return $_[0] 0 0 0
61 0 return $1 . " ad $2 versum " . to_rn($3) . $4 }
62  
63 sub make_range {
64 30 ▶ my ($unit, $five, $ten) = @_;
Subroutine make_range: called CC=1 SCAR=0.0
Pod undocumented
65 30 my ($two, $three) = ($unit x 2, $unit x 3);
66 30 return [ "", $unit, $two, $three, $unit.$five, $five,
67 $five.$unit, $five.$two, $five.$three, $unit.$ten ];
68 }
69  
70 3 my @order = (
71 make_range(qw{ I V X }),
72 make_range(qw{ X L C }),
73 make_range(qw{ C D M }),
74 make_range(qw{ M I)) ((I)) }),
75 make_range(qw{ ((I)) I))) (((I))) }),
76 make_range(qw{ (((I))) I)))) ((((I)))) }),
77 make_range(qw{ ((((I)))) I))))) (((((I))))) }),
78 make_range(qw{ (((((I))))) I)))))) ((((((I)))))) }),
79 make_range(qw{ ((((((I)))))) I))))))) (((((((I))))))) }),
80 make_range(qw{ (((((((I))))))) I)))))))) ((((((((I)))))))) }),
81 );
82  
83 3 my %val;
84 3 foreach my $power (0..$#order) {
85 30 @val{@{$order[$power]}} = map {$_*10**$power} 0..9;
86 }
87  
88 3 my $roman = '(' . join(")(", map {join("|",map { quotemeta } reverse(@$_))} reverse @order) . '|)';
89  
90 sub from_rn {
91 2 ▶ my $val = shift;
Subroutine from_rn: called CC=3 SCAR=11.0
Pod undocumented
92 2 @numerals = $val =~ /(?:$roman)/ix;
93 2 ▶ join("",@numerals) eq $val or return $val;
Branch: 1 branch
BranchTrueFalseTotal
join("", @numerals) eq $val or return $val 0 2 2
94 2 my $an = 0;
95 2 $an += $val{$_} foreach @numerals;
96 2 return $an;
97 }
98  
99 sub __beautify__ {
100 0 ▶ my ($text) = @_;
Subroutine __beautify__: not called CC=1 SCAR=6.9
101 0 $text =~ s/\b(\d+)\b/to_rn($1)/ge;
102 0 return $text;
103 }
104  
105 sub to_rn {
106 0 ▶ return "nullum" if $_[0] == 0;
Subroutine to_rn: not called CC=5 SCAR=34.0
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if $_[0] == 0 0 0 0
107 0 @digits = split '', $_[0];
108 0 ▶ return $_[0] if grep {/\D/} @digits;
Branch: 1 branch
BranchTrueFalseTotal
if grep {/\D/;} @digits 0 0 0
109 0 my $power = 0;
110 0 my $rn = "";
111 0 ▶ $rn = $order[$power++][$_||0] . $rn foreach reverse @digits;
Condition0%0/2
$_ || 0
l!l
00
MC/DC0%0/1
$_ || 0
$_
Truth table0%0/2
A
A= $_
Aresult
11
00
112 0 return $rn;
113 }
114  
115 sub getline {
116 1 ▶ my ($fh) = @_;
Subroutine getline: called CC=5 SCAR=20.9
Pod undocumented
117 1 ▶ if (wantarray) {
Branch: 1 branch
BranchTrueFalseTotal
if (wantarray) { } 0 1 1
118 0 my @lines = IO::Handle::getlines($fh);
119 0 ▶ s/\b($roman)\b/$1 ? from_rn($1) : $1/ge for @lines;
Branch: 1 branch
BranchTrueFalseTotal
$1 ? : 0 0 0
120 0 return @lines;
121 }
122 else {
123 1 my $line = IO::Handle::getline($fh);
124 1 ▶ $line =~ s/\b($roman)\b/$1 ? from_rn($1) : $1/ge;
Branch: 1 branch
BranchTrueFalseTotal
$1 ? : 0 2 2
125 1 return $line;
126 }
127 }
128  
129 sub multibless(\%$$)
130 {
131 99 ▶ my ($hash,$blesstype,$lextype) = @_;
Subroutine multibless: called CC=2 SCAR=6.9
Pod undocumented
132 99 foreach my $key (keys %$hash)
133 {
134 2277 $hash->{$key}{lex} = $lextype;
135 2277 bless $hash->{$key}, $blesstype;
136 }
137 }
138  
139 sub addres(\%$$)
140 {
141 24 ▶ my ($hash,$blesstype,$lextype) = @_;
Subroutine addres: called CC=2 SCAR=6.9
Pod undocumented
142 24 my (%acc, %dat);
143 24 foreach my $key (keys %$hash)
144 {
145 387 $acc{$key.'mentum'} = { %{$hash->{$key}} };
146 387 $acc{$key.'menta'} = { %{$hash->{$key}} };
147 387 $dat{$key.'mento'} = { %{$hash->{$key}} };
148 387 $dat{$key.'mentis'} = { %{$hash->{$key}} };
149 }
150 24 multibless %acc, $blesstype, $lextype.'_ACCUSATIVE';
151 24 multibless %dat, $blesstype, $lextype.'_DATIVE';
152 24 %$hash = ( %$hash, %acc, %dat );
153 }
154  
155 sub add_genitives(\%$$$)
156 {
157 18 ▶ my ($hash, $blesstype, $from, $to) = @_;
Subroutine add_genitives: called CC=3 SCAR=11.0
Pod undocumented
158 18 foreach my $key (keys %$hash)
159 {
160 642 my $genkey = $key;
161 642 ▶ $genkey =~ s/$from$/$to/ or next;
Branch: 1 branch
BranchTrueFalseTotal
$genkey =~ s/$from$/$to/ or next 528 114 642
162 114 $hash->{$genkey} = bless { %{$hash->{$key}},
163 lex => 'GENITIVE' },
164 $blesstype;
165 }
166 }
167  
168 3 my %literals =
169 (
170 'novumversum' => { perl => '"\n"' },
171 'semicolon' => { perl => '";"' },
172 'biguttam' => { perl => '":"' },
173 'guttam' => { perl => '"."' },
174 'comma' => { perl => '","' },
175 'lacunam' => { perl => '" "' },
176 'stadium' => { perl => '"\t"' },
177 'parprimum' => { perl => '$1' },
178 'parsecundum' => { perl => '$2' },
179 'partertium' => { perl => '$3' },
180 'parquartum' => { perl => '$4' },
181 'parquintum' => { perl => '$5' },
182 'parsextum' => { perl => '$6' },
183 'parseptimum' => { perl => '$7' },
184 'paroctavum' => { perl => '$8' },
185 'parnonum' => { perl => '$9' },
186 'pardecimum' => { perl => '$10' },
187 'nomen' => { perl => '$<' },
188 );
189  
190 3 multibless %literals, 'Literal', 'ACCUSATIVE';
191 3 add_genitives %literals, 'Literal', 'um' => 'i';
192 3 add_genitives %literals, 'Literal', 'am' => 'ae';
193 3 add_genitives %literals, 'Literal', 'ma' => 'matis';
194 3 add_genitives %literals, 'Literal', 'ula' => 'uli';
195  
196  
197 3 my %numerals =
198 (
199 'nullum' => { perl => '0' },
200 'unum' => { perl => '1' },
201 'unam' => { perl => '1' },
202 'duo' => { perl => '2' },
203 'duas' => { perl => '2' },
204 'tres' => { perl => '3' },
205 'quattuor' => { perl => '4' },
206 'quinque' => { perl => '5' },
207 'sex' => { perl => '6' },
208 'septem' => { perl => '7' },
209 'octo' => { perl => '8' },
210 'novem' => { perl => '9' },
211 'decem' => { perl => '10' },
212 );
213  
214 3 multibless %numerals, 'Literal', 'NUMERAL';
215  
216  
217 3 my %ordinals_a =
218 (
219 'nullimum' => { perl => '0' },
220 'primum' => { perl => '1' },
221 'secundum' => { perl => '2' },
222 'tertium' => { perl => '3' },
223 'quartum' => { perl => '4' },
224 'quintum' => { perl => '5' },
225 'sextum' => { perl => '6' },
226 'septimum' => { perl => '7' },
227 'octavum' => { perl => '8' },
228 'nonum' => { perl => '9' },
229 'decimum' => { perl => '10' },
230 );
231  
232 3 foreach ( map substr($_,0,-2), keys %ordinals_a ) {
233 33 $ordinals_a{"${_}os"} = $ordinals_a{"${_}um"}; # MASC. PLURALS
234 33 $ordinals_a{"${_}am"} = $ordinals_a{"${_}um"}; # FEMININE
235 33 $ordinals_a{"${_}as"} = $ordinals_a{"${_}um"}; # FEM. PLURALS
236 }
237  
238 3 multibless %ordinals_a, 'Ordinal', 'ORDINAL';
239 3 add_genitives %ordinals_a, 'Ordinal', 'um' => 'i';
240 3 add_genitives %ordinals_a, 'Ordinal', 'am' => 'ae';
241 # add_genitives %ordinals_a, 'Ordinal', 'os' => 'orum';
242  
243 3 my %ordinals_d =
244 (
245 'nullimo' => { perl => '0' },
246 'primo' => { perl => '1' },
247 'secundo' => { perl => '2' },
248 'tertio' => { perl => '3' },
249 'quarto' => { perl => '4' },
250 'quinto' => { perl => '5' },
251 'sexto' => { perl => '6' },
252 'septimo' => { perl => '7' },
253 'octavo' => { perl => '8' },
254 'nono' => { perl => '9' },
255 'decimo' => { perl => '10' },
256 );
257  
258 3 multibless %ordinals_d, 'Ordinal', 'ORDINAL_DATIVE';
259  
260 3 my %special_vars =
261 (
262 'hoc' => { perl => '$_', lex => 'ACCUSATIVE' },
263 'huius' => { perl => '$_', lex => 'GENITIVE' },
264 'huic' => { perl => '$_', lex => 'DATIVE' },
265 'haec' => { perl => '@_', lex => 'ACCUSATIVE' },
266 'horum' => { perl => '@_', lex => 'GENITIVE' },
267 'his' => { perl => '@_', lex => 'DATIVE' },
268 'ianitorem' => { perl => '$/', lex => 'ACCUSATIVE' },
269 'ianitoris' => { perl => '$/', lex => 'GENITIVE' },
270 'ianitori' => { perl => '$/', lex => 'DATIVE' },
271 'programma' => { perl => '$0', lex => 'ACCUSATIVE' },
272 'programmati' => { perl => '$0', lex => 'DATIVE' },
273 'programmatis' => { perl => '$0', lex => 'GENITIVE' },
274 'parametra' => { perl => '@ARGV', lex => 'ACCUSATIVE' },
275 'parametris' => { perl => '@ARGV', lex => 'DATIVE' },
276 'parametrorum' => { perl => '@ARGV', lex => 'GENITIVE' },
277 );
278  
279 3 for my $key ( keys %special_vars )
280 {
281 45 bless $special_vars{$key}, 'Literal';
282 }
283  
284 3 my %varmods =
285 (
286 'loco' => bless ({ perl => 'local', lex => 'OWNER_D' },
287 'ScalarMod'),
288 'locis' => bless ({ perl => 'local', lex => 'OWNER_D' },
289 'ArrMod'),
290 'meo' => bless ({ perl => 'my', lex => 'OWNER_D' },
291 'ScalarMod'),
292 'meis' => bless ({ perl => 'my', lex => 'OWNER_D' },
293 'ArrMod'),
294 'nostro' => bless ({ perl => 'our', lex => 'OWNER_D' },
295 'ScalarMod'),
296 'nostris' => bless ({ perl => 'our', lex => 'OWNER_D' },
297 'ArrMod'),
298 );
299  
300 3 my %streams =
301 (
302 'parametro' => { perl => '*ARGV' },
303 'vestibulo' => { perl => '*STDIN' },
304 'egresso' => { perl => 'STDOUT' },
305 'oraculo' => { perl => 'STDERR' },
306 'nuntio' => { perl => '*Lingua::Romana::Perligata::DATA' },
307 );
308 3 multibless %streams, 'Literal', 'DATIVE';
309  
310 3 my %matchops =
311 (
312 'compara' => { perl => 'm' },
313 'substitue' => { perl => 's' },
314 'converte' => { perl => 'tr' },
315 );
316  
317 3 multibless %matchops, 'MatchOperator', 'SUBNAME';
318 3 addres %matchops, 'MatchOperator', 'SUBNAME';
319  
320 3 my %ops =
321 (
322 'adde' => { perl => '+' },
323 'deme' => { perl => '-' },
324 'multiplica' => { perl => '*' },
325 'itera' => { perl => 'x' },
326 'divide' => { perl => '/' },
327 'recide' => { perl => '%' },
328 'eleva' => { perl => '**' },
329 'consocia' => { perl => '&' },
330 'interseca' => { perl => '|' },
331 'discerne' => { perl => '^' },
332 'depone' => { perl => '' , prefix => 1 },
333 );
334  
335 3 $ops{$_}{operator} = 1 foreach keys %ops;
336 3 multibless %ops, 'Operator', 'SUBNAME_A';
337 3 addres %ops, 'Operator', 'SUBNAME_A';
338  
339 3 my %lops =
340 (
341 'da' => { perl => '=', operator => 1 },
342 );
343  
344 3 multibless %lops, 'Operator', 'SUBNAME_AD';
345 3 addres %lops, 'Operator', 'SUBNAME_AD';
346  
347 3 my %invarops =
348 (
349 'atque' => { perl => '&&' },
350 'vel' => { perl => '||' },
351 'praestantiam' => { perl => '<' },
352 'non praestantiam' => { perl => '>=' },
353 'praestantias' => { perl => 'lt' },
354 'non praestantias' => { perl => 'ge' },
355 'aequalitam' => { perl => '==' },
356 'non aequalitam' => { perl => '!=' },
357 'aequalitas' => { perl => 'eq' },
358 'non aequalitas' => { perl => 'ne' },
359 'comparitiam' => { perl => '<=>' },
360 'comparitias' => { perl => 'cmp' },
361 'non comparitiam' => { perl => '!<=>' },
362 'non comparitias' => { perl => '!cmp' },
363  
364 'non' => { perl => '!', prefix => 1 },
365 'nega' => { perl => '-', prefix => 1 },
366 );
367  
368 3 $invarops{$_}{operator} = 1 foreach keys %invarops;
369 3 multibless %invarops, 'Operator', 'SUBNAME_A_ACCUSATIVE';
370  
371 3 my %connectives =
372 (
373 'que' => { perl => 'and' },
374 've' => { perl => 'or' },
375 );
376  
377 3 @{$connectives{$_}}{'operator','raw'} = (1,-$_) foreach keys %connectives;
378 3 multibless %connectives, 'Operator', 'CONNECTIVE';
379  
380 3 my %funcs_td =
381 (
382 'excerpe' => { perl => 'substr' }, # SPECIAL: SEE BELOW
383  
384 'cumula' => { perl => 'push' },
385 'capita' => { perl => 'unshift' },
386 'iunge' => { perl => 'splice' },
387 'digere' => { perl => 'sort' },
388 'retexe' => { perl => 'reverse' },
389 'evolute' => { perl => 'open' },
390 'lege' => { perl => 'read' },
391 'scribe' => { perl => 'print' },
392 'describe' => { perl => 'printf' },
393 'subscribe' => { perl => 'write' },
394 'conquire' => { perl => 'seek' },
395 'benedice' => { perl => 'bless' },
396 'liga' => { perl => 'tie' },
397 'modera' => { perl => 'fcntl' },
398 'conflue' => { perl => 'flock' },
399 'impera' => { perl => 'ioctl' },
400 'trunca' => { perl => 'truncate' },
401 );
402  
403 3 multibless %funcs_td, 'Function', 'SUBNAME_AD';
404 3 addres %funcs_td, 'Function', 'SUBNAME_AD';
405  
406 # "bless" HAS A COMMON LATIN CONTRACTION...
407  
408 3 $funcs_td{benedictum} = $funcs_td{benedicementum};
409 3 $funcs_td{benedicto} = $funcs_td{benedicemento};
410  
411 # THE FOLLOWING IS LVALUABLE, SO ARG MUST AGREE IN CASE WITH FUNCTION'S CASE...
412  
413 3 for (qw( excerpe )) {
414 3 $funcs_td{"${_}mentum"}{lex} = 'SUBNAME_A_ACCUSATIVE';
415 }
416  
417  
418 3 my %funcs_bd =
419 (
420 'vanne' => { perl => 'grep' },
421 'applica' => { perl => 'map' },
422 'digere' => { perl => 'sort' },
423 );
424  
425 3 multibless %funcs_bd, 'Function', 'SUBNAME_AB';
426 3 addres %funcs_bd, 'Function', 'SUBNAME_AB';
427  
428 3 my %funcs_b =
429 (
430 'factorem' => { perl => 'sub' },
431 'factori' => { perl => 'sub' },
432 );
433  
434 3 multibless %funcs_b, 'Function', 'SUBNAME_B_ACCUSATIVE';
435 3 $funcs_b{'factori'}{lex} = 'SUBNAME_B_DATIVE';
436  
437  
438 3 my %funcs_t =
439 (
440 'morde' => { perl => 'chomp' },
441 'praecide' => { perl => 'chop' },
442 'stude' => { perl => 'study' },
443 'iani' => { perl => 'undef' },
444 'lusta' => { perl => 'reset' },
445 'decumula' => { perl => 'pop' },
446 'decapita' => { perl => 'shift' },
447 'claude' => { perl => 'close' },
448 'perlege' => { perl => 'Lingua::Romana::Perligata::getline' },
449 'sublege' => { perl => 'getc' },
450 'enunta' => { perl => 'tell' },
451 'dele' => { perl => 'delete' },
452 'quisque' => { perl => 'each' },
453 'adfirma' => { perl => 'exists' },
454 'solvere' => { perl => 'untie' },
455 'preincresce' => { perl => '++', prefix => 1, operator => 1 },
456 'postincresce' => { perl => '++', prefix => 0, operator => 1 },
457 'predecresce' => { perl => '--', prefix => 1, operator => 1 },
458 'postdecresce' => { perl => '--', prefix => 0, operator => 1 },
459  
460 'reperi' => { perl => 'pos' }, # SPECIAL: SEE BELOW
461 'nomina' => { perl => 'keys' }, # SPECIAL: SEE BELOW
462 );
463  
464 3 multibless %funcs_t, 'Function', 'SUBNAME_D';
465 3 addres %funcs_t, 'Function', 'SUBNAME_D';
466  
467  
468 # THE FOLLOWING ARE LVALUABLE, SO ARG MUST AGREE IN CASE WITH FUNCTION'S CASE...
469  
470 3 for (qw( reperi nomina )) {
471 6 $funcs_t{"${_}mentum"}{lex} = 'SUBNAME_A_ACCUSATIVE';
472 }
473  
474 3 my %funcs_d =
475 (
476 'admeta' => { perl => 'Lingua::Romana::Perligata::__lastelem__' },
477 'inque' => { perl => 'Lingua::Romana::Perligata::__enquote__' },
478 'conscribe' => { perl => 'Lingua::Romana::Perligata::__enlist__' },
479 'come' => { perl => 'Lingua::Romana::Perligata::__beautify__' },
480 'priva' => { perl => 'abs' },
481 'angula' => { perl => 'atan2' },
482 'oppone' => { perl => 'sin' },
483 'accuba' => { perl => 'cos' },
484 'decolla' => { perl => 'int' },
485 'succide' => { perl => 'log' },
486 'fode' => { perl => 'sqrt' },
487 'conice' => { perl => 'rand' },
488 'prosemina' => { perl => 'srand' },
489 'inde' => { perl => 'chr' },
490 'senidemi' => { perl => 'hex' },
491 'octoni' => { perl => 'oct' },
492 'numera' => { perl => 'ord' },
493 'deminue' => { perl => 'lc' },
494 'minue' => { perl => 'lcfirst' },
495 'amplifica' => { perl => 'uc' },
496 'amplia' => { perl => 'ucfirst' },
497 'excipe' => { perl => 'quotemeta' },
498 'huma' => { perl => 'crypt' },
499 'meta' => { perl => 'length' },
500 'convasa' => { perl => 'pack' },
501 'deconvasa' => { perl => 'unpack' },
502 'scinde' => { perl => 'split' },
503 'scruta' => { perl => 'index' },
504 'coniunge' => { perl => 'join' },
505 'confirma' => { perl => 'defined' },
506 'secerna' => { perl => 'scalar' },
507 'argue' => { perl => 'values' },
508 'extremus' => { perl => 'eof' },
509 'deside' => { perl => 'wantarray' },
510 'aestima' => { perl => 'eval' },
511 'exi' => { perl => 'exit' },
512 'redde' => { perl => 'return' },
513 'mori' => { perl => 'die' },
514 'mone' => { perl => 'warn' },
515 'coaxa' => { perl => 'Carp::croak' },
516 'carpe' => { perl => 'Carp::carp' },
517 'memora' => { perl => 'caller' },
518 'agnosce' => { perl => 'ref' },
519 'exhibere' => { perl => 'tied' },
520 'require' => { perl => 'require' },
521 'demigrare' => { perl => 'chdir' },
522 'permitte' => { perl => 'chmod' },
523 'vende' => { perl => 'chown' },
524 'inveni' => { perl => 'glob' },
525 'copula' => { perl => 'link' },
526 'decopula' => { perl => 'unlink' },
527 'aedifica' => { perl => 'mkdir' },
528 'renomina' => { perl => 'rename' },
529 'excide' => { perl => 'rmdir' },
530 'exprime' => { perl => 'stat' },
531 'terre' => { perl => 'alarm' },
532 'mitte' => { perl => 'dump' },
533 'commuta' => { perl => 'exec' },
534 'furca' => { perl => 'fork' },
535 'interfice' => { perl => 'kill' },
536 'dormi' => { perl => 'sleep' },
537 'obsecra' => { perl => 'system' },
538 'dissimula' => { perl => 'umask' },
539 'manta' => { perl => 'wait' },
540  
541 'inscribe' => { perl => ':' }, # SPECIAL: SEE BELOW
542 'arcesse' => { perl => '${' }, # SPECIAL: SEE BELOW
543  
544 'sere' => { perl => 'Lingua::Romana::Perligata::__encatenate__' },
545 );
546  
547 3 multibless %funcs_d, 'Function', 'SUBNAME_A';
548 3 addres %funcs_d, 'Function', 'SUBNAME_A';
549  
550 # 'inscribe' IS SPECIAL: ONLY IMPERATIVE
551  
552 3 delete @funcs_d{grep /^inscribement/, keys %funcs_d};
553  
554 # 'arcesse' IS SPECIAL: NO IMPERATIVE AND EXTRA (PSEUDO-)RESULTATIVES
555  
556 3 delete $funcs_d{'arcesse'};
557  
558 # SCALAR AS NON-TERMINAL INDEX
559  
560 3 $funcs_d{'arcessementi'} = { %{$funcs_d{'arcessementum'}},
561 lex => 'SUBNAME_A_GENITIVE' };
562  
563 # ARRAY DEREFERENCE
564  
565 3 $funcs_d{'arcessementa'}{perl} = '@{';
566 3 $funcs_d{'arcessementis'}{perl} = '@{';
567 3 $funcs_d{'arcessementorum'} = { %{$funcs_d{'arcessementa'}},
568 lex => 'SUBNAME_A_GENITIVE' };
569  
570 3 $funcs_d{'arcessementus'} = { %{$funcs_d{'arcessementa'}}, perl => '%{' };
571 3 $funcs_d{'arcessementibus'} = { %{$funcs_d{'arcessementis'}}, perl => '%{' };
572 3 $funcs_d{'arcessementuum'} = { %{$funcs_d{'arcessementus'}},
573 lex => 'SUBNAME_A_GENITIVE'};
574  
575  
576 3 my %funcs_dl =
577 (
578 'adi' => { perl => 'goto' },
579 'confectus' => { perl => 'continue' },
580 'domus' => { perl => 'package' },
581 'legatarius' => { perl => 'use base' },
582 'ute' => { perl => 'use' },
583 );
584  
585 3 multibless %funcs_dl, 'Function_Lit', 'SUBNAME_A';
586 3 addres %funcs_dl, 'Function_Lit', 'SUBNAME_A';
587  
588 3 my %funcs_dlo =
589 (
590 'ultimus' => { perl => 'last' },
591 'posterus' => { perl => 'next' },
592 'reconnatus' => { perl => 'redo' },
593 );
594  
595 3 multibless %funcs_dlo, 'Function_Lit', 'SUBNAME_OA';
596 # addres %funcs_dl, 'Function_Lit', 'SUBNAME_OA';
597  
598 3 my %misc =
599 (
600 'fac' => { lex => 'DO', perl => 'do' },
601 'per' => { lex => 'FOR', perl => 'for' },
602 'per quisque' => { lex => 'FOR', perl => 'foreach' },
603 'si' => { lex => 'CONTROL', perl => 'if' },
604 'nisi' => { lex => 'CONTROL', perl => 'unless' },
605 'donec' => { lex => 'CONTROL', perl => 'until' },
606 'dum' => { lex => 'CONTROL', perl => 'while' },
607 'cum' => { lex => 'WITH', perl => '' },
608 'intra' => { lex => 'WITHIN', perl => '::' },
609 'apud' => { lex => 'ARROW', perl => '->' },
610 'tum' => { lex => 'COMMA', perl => ',' },
611 'in' => { lex => 'IN', perl => '' },
612 'sic' => { lex => 'BEGIN', perl => '{' },
613 'cis' => { lex => 'END', perl => '}' },
614 'princeps' => { lex => 'NAME', raw=>'main', perl => 'main' },
615 'ad' => { lex => 'ADDRESS', perl => '\\' },
616 );
617  
618 3 my %tokens =
619 (
620 %literals, %numerals, %special_vars,
621 %numerals, %ordinals_a, %ordinals_d,
622 %varmods, %matchops, %ops, %lops, %invarops,
623 %funcs_td, %funcs_bd, %funcs_b, %funcs_t,
624 %funcs_d, %funcs_dl, %funcs_dlo,
625 %misc, %streams,
626 );
627  
628 # Handle likely captialization variations...
629 3 @tokens{map {ucfirst} keys %tokens} = values %tokens;
630  
631 3 foreach my $key ( keys %tokens )
632 {
633 $tokens{$key}{raw} = $key
634 4974 ▶ unless $tokens{$key}{raw};
Branch: 1 branch
BranchTrueFalseTotal
unless $tokens{$key}{"raw"} 2379 2595 4974
635 }
636  
637 3 my $distokens = join '|', reverse sort keys %tokens;
638 3 my $tokens = "\\A\\s*($distokens)\\b";
639 3 my $tokensque = "\\A\\s*($distokens)que\\b";
640 3 my $tokensve = "\\A\\s*($distokens)ve\\b";
641  
642 sub token($$$$)
643 {
644 28 ▶ my ($raw, $lex, $perl, $blesstype) = @_;
Subroutine token: called CC=1 SCAR=0.0
Pod undocumented
645 28 return bless { raw => $raw, lex => $lex, perl => $perl }, $blesstype;
646 }
647  
648 sub tokdup
649 {
650 94 ▶ my ($archetype) = @_;
Subroutine tokdup: called CC=1 SCAR=0.0
Pod undocumented
651 94 bless { %$archetype }, $archetype->{lex};
652 }
653  
654 sub tokenize
655 {
656 6 ▶ my ($text) = @_;
Subroutine tokenize: called CC=107 SCAR=83.3
Pod undocumented
657 6 my @tokens;
658 6 my $bad = "";
659 6 my $lines = $text =~ tr/\n/\n/;
660  
661 6 ▶ while (length $text)
Branch: 1 branch
BranchTrueFalseTotal
if (length $text) 125 6 131
662 {
663 125 $text =~ s/\A\s+//;
664 125 my $line = $lines - ($text =~ tr/\n/\n/) + $offset;
665 125 ▶ if ($text =~ s/\A(adnota.*)//i)
Branch: 30 branches
BranchTrueFalseTotal
if ($text =~ s/\A(adnota.*)//i) { } 0 125 125
elsif ($text =~ s/\A(nuntius|finis)[ \t]*[.]?[ \t]*\n(.*)//ism) { } 0 125 125
elsif ($text =~ s/\Adic(?:emen)?tum(que|ve|)\s+sic\s+\b(.*?)\s+cis\b//is) { } 3 122 125
elsif ($text =~ s/\Asic(que|ve|)\s+(.*?)\s+cis\s+dic(?:emen)?tum\b//is) { } 0 122 122
elsif ($text =~ s/\A(atque|vel)\b//i) { } 0 122 122
elsif ($text =~ s/\A(($roman)im(?:o|ae)(que|ve|))\b//xi and length $2) { } 0 122 122
elsif ($text =~ s/\A(($roman)im(?:um|os|am|as)(que|ve|))\b//xi and length $2) { } 0 122 122
elsif ($text =~ s/\A(($roman)(que|ve|))\b//xi and length $2) { } 2 120 122
elsif ($text =~ s/$tokensque//i) { } 0 120 120
elsif ($text =~ s/$tokensve//i) { } 0 120 120
elsif ($text =~ s/$tokens//i) { } 94 26 120
elsif ($text =~ s/\A(([a-z_][0-9a-z_]*?)(um|)ementum)(que|ve|)((?:\s+)sicut)?\b//i) { } 0 26 26
elsif ($text =~ s/\A(([a-z_][0-9a-z_]*?)(um|)ementa)(que|ve|)((?:\s+)sicut)?\b//i) { } 0 26 26
elsif ($text =~ s/\A(([a-z_][0-9a-z_]*?)(um|)emento)(que|ve|)((?:\s+)sicut)?\b//i) { } 0 26 26
elsif ($text =~ s/\A(([a-z_][0-9a-z_]*?)(um|)ementis)(que|ve|)((?:\s+)sicut)?\b//i) { } 0 26 26
elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)orum)(que|ve|)((?:\s+)sicut)?\b//i) { } 0 26 26
elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)uum)(que|ve|)((?:\s+)sicut)?\b//i) { } 0 26 26
elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)um)(que|ve|)((?:\s+)sicut)?\b//i) { } 5 21 26
elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)a)(que|ve|)((?:\s+)sicut)?\b//i) { } 0 21 21
elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)ibus)(que|ve|)((?:\s+)sicut)?\b//i) { } 0 21 21
elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)us)(que|ve|)((?:\s+)sicut)?\b//i) { } 0 21 21
elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)o)(que|ve|)((?:\s+)sicut)?\b//i) { } 1 20 21
elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)is)(que|ve|)((?:\s+)sicut)?\b//i) { } 0 20 20
elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)tori)(que|ve|)((?:\s+)sicut)?\b//i) { } 0 20 20
elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)i)(que|ve|)((?:\s+)sicut)?\b//i) { } 0 20 20
elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)ere)(que|ve|)((?:\s+)sicut)?\b//i) { } 2 18 20
elsif ($text =~ s/\A(([a-z_][0-9a-z_]*?)(um|)e)(que|ve|)((?:\s+)sicut)?\b//i) { } 2 16 18
elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)torem)(que|ve|)((?:\s+)sicut)?\b//i) { } 0 16 16
elsif ($text =~ s/\A([.])//) { } 11 5 16
elsif ($text =~ s/\A(\S+)(que|ve|)((?:\s+)sicut)?\b//) { } 2 3 5
666 {
667 # ignore comments
668 }
669 elsif ($text =~ s/\A(nuntius|finis)[ \t]*[.]?[ \t]*\n(.*)//smi)
670 {
671 # set up DATA stream
672 3 ▶ use vars '*DATA';
Subroutine BEGIN: called CC=1 SCAR=0.0
673 0 local *Lingua::Romana::Perlidata::DATASRC;
674 0 my $pipe = pipe \*Lingua::Romana::Perligata::DATA,
675 \*Lingua::Romana::Perlidata::DATASRC;
676  
677 0 print Lingua::Romana::Perlidata::DATASRC $2;
678 }
679 elsif ($text =~ s/\Adic(?:emen)?tum(que|ve|)\s+sic\s+\b(.*?)\s+cis\b//si)
680 {
681 3 ▶ push @tokens, tokdup $connectives{lc $1} if $1;
Branch: 1 branch
BranchTrueFalseTotal
if $1 0 3 3
682 3 push @tokens, token($2,'NAME',"$2",'Name');
683 }
684 elsif ($text =~ s/\Asic(que|ve|)\s+(.*?)\s+cis\s+dic(?:emen)?tum\b//si)
685 {
686 0 ▶ push @tokens, tokdup $connectives{lc $1} if $1;
Branch: 1 branch
BranchTrueFalseTotal
if $1 0 0 0
687 0 push @tokens, token($2,'NAME',"$2",'Name');
688 }
689 elsif ($text =~ s/\A(atque|vel)\b//i)
690 {
691 0 push @tokens, tokdup $misc{'tum'};
692 0 push @tokens, tokdup $invarops{lc $1};
693 }
694 ▶ elsif ($text =~ s/\A(($roman)im(?:o|ae)(que|ve|))\b//ix && length $2)
Condition33%1/3
$text =~ s/\A(($roman)im(?:o|ae)(que|ve|))\b//xi and length $2
!ll&&!rl&&r
12200
MC/DC0%0/2
$text =~ s/\A(($roman)im(?:o|ae)(que|ve|))\b//xi and length $2
$text =~ s/\A(($roman)im(?:o|ae)(que|ve|))\b//xi length $2
Truth table33%1/3
A and B
A= $text =~ s/\A(($roman)im(?:o|ae)(que|ve|))\b//xiB= length $2
ABresult
0X0
100
111
695 {
696 0 ▶ push @tokens, tokdup $connectives{lc $+} if $+;
Branch: 1 branch
BranchTrueFalseTotal
if $+ 0 0 0
697 0 push @tokens, token($1,'ORDINAL_DATIVE',from_rn($2),'ORDINAL_DATIVE');
698 }
699 ▶ elsif ($text =~ s/\A(($roman)im(?:um|os|am|as)(que|ve|))\b//ix && length $2)
Condition33%1/3
$text =~ s/\A(($roman)im(?:um|os|am|as)(que|ve|))\b//xi and length $2
!ll&&!rl&&r
12200
MC/DC0%0/2
$text =~ s/\A(($roman)im(?:um|os|am|as)(que|ve|))\b//xi and length $2
$text =~ s/\A(($roman)im(?:um|os|am|as)(que|ve|))\b//xi length $2
Truth table33%1/3
A and B
A= $text =~ s/\A(($roman)im(?:um|os|am|as)(que|ve|))\b//xiB= length $2
ABresult
0X0
100
111
700 {
701 0 ▶ push @tokens, tokdup $connectives{lc $+} if $+;
Branch: 1 branch
BranchTrueFalseTotal
if $+ 0 0 0
702 0 push @tokens, token($1,'ORDINAL',from_rn($2),'ORDINAL');
703 }
704 ▶ elsif ($text =~ s/\A(($roman)(que|ve|))\b//ix && length $2)
Condition100%3/3
$text =~ s/\A(($roman)(que|ve|))\b//xi and length $2
!ll&&!rl&&r
141062
MC/DC100%2/2
$text =~ s/\A(($roman)(que|ve|))\b//xi and length $2
$text =~ s/\A(($roman)(que|ve|))\b//xi length $2
Truth table100%3/3
A and B
A= $text =~ s/\A(($roman)(que|ve|))\b//xiB= length $2
ABresult
0X0
100
111
705 {
706 2 ▶ push @tokens, tokdup $connectives{lc $+} if $+;
Branch: 1 branch
BranchTrueFalseTotal
if $+ 0 2 2
707 2 push @tokens, token($1,'NUMERAL',from_rn($2),'NUMERAL');;
708 }
709 elsif ($text =~ s/$tokensque//i)
710 {
711 0 push @tokens, tokdup $connectives{'que'};
712 0 push @tokens, tokdup $tokens{lc $1};
713 }
714 elsif ($text =~ s/$tokensve//i)
715 {
716 0 push @tokens, tokdup $connectives{'ve'};
717 0 push @tokens, tokdup $tokens{lc $1};
718 }
719 elsif ($text =~ s/$tokens//i)
720 {
721 94 push @tokens, tokdup $tokens{lc $1};
722 }
723 elsif ($text =~ s/\A(([a-z_][0-9a-z_]*?)(um|)ementum)(que|ve|)((?:\s+)sicut)?\b//i)
724 {
725 0 ▶ if ($5)
Branch: 1 branch
BranchTrueFalseTotal
if ($5) { } 0 0 0
726 {
727 0 ▶ my $token = $4 ? $1.$4 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$4 ? : 0 0 0
728 0 push @tokens, token($token,'NAME',$token,'Name');
729 }
730 else
731 {
732 0 ▶ push @tokens, tokdup $connectives{lc $4} if $4;
Branch: 1 branch
BranchTrueFalseTotal
if $4 0 0 0
733 0 ▶ my $perl = $3 ? "\$$2->" : $2;
Branch: 1 branch
BranchTrueFalseTotal
$3 ? : 0 0 0
734 0 push @tokens, token($1,'SUBNAME_OA_ACCUSATIVE',$perl,'Literal');
735 }
736 }
737 elsif ($text =~ s/\A(([a-z_][0-9a-z_]*?)(um|)ementa)(que|ve|)((?:\s+)sicut)?\b//i)
738 {
739 0 ▶ if ($5)
Branch: 1 branch
BranchTrueFalseTotal
if ($5) { } 0 0 0
740 {
741 0 ▶ my $token = $4 ? $1.$4 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$4 ? : 0 0 0
742 0 push @tokens, token($token,'NAME',$token,'Name');
743 }
744 else
745 {
746 0 ▶ push @tokens, tokdup $connectives{lc $4} if $4;
Branch: 1 branch
BranchTrueFalseTotal
if $4 0 0 0
747 0 ▶ my $perl = $3 ? "\$$2->" : $2;
Branch: 1 branch
BranchTrueFalseTotal
$3 ? : 0 0 0
748 0 push @tokens, token($1,'SUBNAME_OA_ACCUSATIVE',$perl,'Literal');
749 }
750 }
751 elsif ($text =~ s/\A(([a-z_][0-9a-z_]*?)(um|)emento)(que|ve|)((?:\s+)sicut)?\b//i)
752 {
753 0 ▶ if ($5)
Branch: 1 branch
BranchTrueFalseTotal
if ($5) { } 0 0 0
754 {
755 0 ▶ my $token = $4 ? $1.$4 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$4 ? : 0 0 0
756 0 push @tokens, token($token,'NAME',$token,'Name');
757 }
758 else
759 {
760 0 ▶ push @tokens, tokdup $connectives{lc $4} if $4;
Branch: 1 branch
BranchTrueFalseTotal
if $4 0 0 0
761 0 ▶ my $perl = $3 ? "\$$2->" : $2;
Branch: 1 branch
BranchTrueFalseTotal
$3 ? : 0 0 0
762 0 push @tokens, token($1,'SUBNAME_OA_DATIVE',$perl,'Literal');
763 }
764 }
765 elsif ($text =~ s/\A(([a-z_][0-9a-z_]*?)(um|)ementis)(que|ve|)((?:\s+)sicut)?\b//i)
766 {
767 0 ▶ if ($5)
Branch: 1 branch
BranchTrueFalseTotal
if ($5) { } 0 0 0
768 {
769 0 ▶ my $token = $4 ? $1.$4 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$4 ? : 0 0 0
770 0 push @tokens, token($token,'NAME',"$token",'Name');
771 }
772 else
773 {
774 0 $bad .= "'-mentis' illicitum: '$1'"
775 . adversum({line=>$line});
776 # One day this may be:
777 #
778 # push @tokens, tokdup $connectives{lc $4} if $4;
779 # my $perl = $3 ? "\$$2->" : $2;
780 # push @tokens, token($1,'SUBNAME_OA_DATIVE',$perl,'Literal');
781 }
782 }
783 elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)orum)(que|ve|)((?:\s+)sicut)?\b//i)
784 {
785 0 ▶ if ($4)
Branch: 1 branch
BranchTrueFalseTotal
if ($4) { } 0 0 0
786 {
787 0 ▶ my $token = $3 ? $1.$3 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$3 ? : 0 0 0
788 0 push @tokens, token($token,'NAME',$token,'Name');
789 }
790 else
791 {
792 0 ▶ push @tokens, tokdup $connectives{lc $3} if $3;
Branch: 1 branch
BranchTrueFalseTotal
if $3 0 0 0
793 0 push @tokens, token($1,'GENITIVE',"\@$2",'Literal');
794 }
795 }
796 elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)uum)(que|ve|)((?:\s+)sicut)?\b//i)
797 {
798 0 ▶ if ($4)
Branch: 1 branch
BranchTrueFalseTotal
if ($4) { } 0 0 0
799 {
800 0 ▶ my $token = $3 ? $1.$3 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$3 ? : 0 0 0
801 0 push @tokens, token($token,'NAME',$token,'Name');
802 }
803 else
804 {
805 0 ▶ push @tokens, tokdup $connectives{lc $3} if $3;
Branch: 1 branch
BranchTrueFalseTotal
if $3 0 0 0
806 0 push @tokens, token($1,'GENITIVE',"\%$2",'Literal');
807 }
808 }
809 elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)um)(que|ve|)((?:\s+)sicut)?\b//i)
810 {
811 5 ▶ if ($4)
Branch: 1 branch
BranchTrueFalseTotal
if ($4) { } 0 5 5
812 {
813 0 ▶ my $token = $3 ? $1.$3 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$3 ? : 0 0 0
814 0 push @tokens, token($token,'NAME',$token,'Name');
815 }
816 else
817 {
818 5 ▶ push @tokens, tokdup $connectives{lc $3} if $3;
Branch: 1 branch
BranchTrueFalseTotal
if $3 0 5 5
819 5 push @tokens, token($1,'ACCUSATIVE',"\$$2",'Literal');
820 }
821 }
822 elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)a)(que|ve|)((?:\s+)sicut)?\b//i)
823 {
824 0 ▶ if ($4)
Branch: 1 branch
BranchTrueFalseTotal
if ($4) { } 0 0 0
825 {
826 0 ▶ my $token = $3 ? $1.$3 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$3 ? : 0 0 0
827 0 push @tokens, token($token,'NAME',$token,'Name');
828 }
829 else
830 {
831 0 ▶ push @tokens, tokdup $connectives{lc $3} if $3;
Branch: 1 branch
BranchTrueFalseTotal
if $3 0 0 0
832 0 push @tokens, token($1,'ACCUSATIVE',"\@$2",'Literal');
833 }
834 }
835 elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)ibus)(que|ve|)((?:\s+)sicut)?\b//i)
836 {
837 0 ▶ if ($4)
Branch: 1 branch
BranchTrueFalseTotal
if ($4) { } 0 0 0
838 {
839 0 ▶ my $token = $3 ? $1.$3 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$3 ? : 0 0 0
840 0 push @tokens, token($token,'NAME',$token,'Name');
841 }
842 else
843 {
844 0 ▶ push @tokens, tokdup $connectives{lc $3} if $3;
Branch: 1 branch
BranchTrueFalseTotal
if $3 0 0 0
845 0 push @tokens, token($1,'DATIVE',"\%$2",'Literal');
846 }
847 }
848 elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)us)(que|ve|)((?:\s+)sicut)?\b//i)
849 {
850 0 ▶ if ($4)
Branch: 1 branch
BranchTrueFalseTotal
if ($4) { } 0 0 0
851 {
852 0 ▶ my $token = $3 ? $1.$3 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$3 ? : 0 0 0
853 0 push @tokens, token($token,'Name',$token,'Name');
854 }
855 else
856 {
857 0 ▶ push @tokens, tokdup $connectives{lc $3} if $3;
Branch: 1 branch
BranchTrueFalseTotal
if $3 0 0 0
858 0 push @tokens, token($1,'ACCUSATIVE',"\%$2",'Literal');
859 }
860 }
861 elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)o)(que|ve|)((?:\s+)sicut)?\b//i)
862 {
863 1 ▶ if ($4)
Branch: 1 branch
BranchTrueFalseTotal
if ($4) { } 0 1 1
864 {
865 0 ▶ my $token = $3 ? $1.$3 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$3 ? : 0 0 0
866 0 push @tokens, token($token,'NAME',$token,'Name');
867 }
868 else
869 {
870 1 ▶ push @tokens, tokdup $connectives{lc $3} if $3;
Branch: 1 branch
BranchTrueFalseTotal
if $3 0 1 1
871 1 push @tokens, token($1,'DATIVE',"\$$2",'Literal');
872 }
873 }
874 elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)is)(que|ve|)((?:\s+)sicut)?\b//i)
875 {
876 0 ▶ if ($4)
Branch: 1 branch
BranchTrueFalseTotal
if ($4) { } 0 0 0
877 {
878 0 ▶ my $token = $3 ? $1.$3 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$3 ? : 0 0 0
879 0 push @tokens, token($token,'NAME',$token,'Name');
880 }
881 else
882 {
883 0 ▶ push @tokens, tokdup $connectives{lc $3} if $3;
Branch: 1 branch
BranchTrueFalseTotal
if $3 0 0 0
884 0 push @tokens, token($1,'DATIVE',"\@$2",'Literal');
885 }
886 }
887 elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)tori)(que|ve|)((?:\s+)sicut)?\b//i)
888 {
889 0 ▶ if ($4)
Branch: 1 branch
BranchTrueFalseTotal
if ($4) { } 0 0 0
890 {
891 0 ▶ my $token = $3 ? $1.$3 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$3 ? : 0 0 0
892 0 push @tokens, token($token,'NAME',$token,'Name');
893 }
894 else
895 {
896 0 ▶ push @tokens, tokdup $connectives{lc $3} if $3;
Branch: 1 branch
BranchTrueFalseTotal
if $3 0 0 0
897 0 push @tokens, token($1,'DATIVE',"\\&$2",'Literal');
898 }
899 }
900 elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)i)(que|ve|)((?:\s+)sicut)?\b//i)
901 {
902 0 ▶ if ($4)
Branch: 1 branch
BranchTrueFalseTotal
if ($4) { } 0 0 0
903 {
904 0 ▶ my $token = $3 ? $1.$3 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$3 ? : 0 0 0
905 0 push @tokens, token($token,'NAME',$token,'Name');
906 }
907 else
908 {
909 0 ▶ push @tokens, tokdup $connectives{lc $3} if $3;
Branch: 1 branch
BranchTrueFalseTotal
if $3 0 0 0
910 0 push @tokens, token($1,'GENITIVE',"\$$2",'Literal');
911 }
912 }
913 elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)ere)(que|ve|)((?:\s+)sicut)?\b//i)
914 {
915 2 ▶ if ($4)
Branch: 1 branch
BranchTrueFalseTotal
if ($4) { } 0 2 2
916 {
917 0 ▶ my $token = $3 ? $1.$3 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$3 ? : 0 0 0
918 0 push @tokens, token($token,'NAME',$token,'Name');
919 }
920 else
921 {
922 2 ▶ push @tokens, tokdup $connectives{lc $3} if $3;
Branch: 1 branch
BranchTrueFalseTotal
if $3 0 2 2
923 2 push @tokens, token($1,'INFINITIVE',"$2",'Literal');
924 }
925 }
926 elsif ($text =~ s/\A(([a-z_][0-9a-z_]*?)(um|)e)(que|ve|)((?:\s+)sicut)?\b//i)
927 {
928 2 ▶ if ($5)
Branch: 1 branch
BranchTrueFalseTotal
if ($5) { } 0 2 2
929 {
930 0 ▶ my $token = $4 ? $1.$4 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$4 ? : 0 0 0
931 0 push @tokens, token($token,'NAME',$token,'Name');
932 }
933 else
934 {
935 2 ▶ push @tokens, tokdup $connectives{lc $4} if $4;
Branch: 1 branch
BranchTrueFalseTotal
if $4 0 2 2
936 2 ▶ my $perl = $3 ? "\$$2->" : $2;
Branch: 1 branch
BranchTrueFalseTotal
$3 ? : 0 2 2
937 2 push @tokens, token($1,'SUBNAME',$perl,'Literal');
938 }
939 }
940 elsif ($text =~ s/\A(([a-z_][0-9a-z_]*)torem)(que|ve|)((?:\s+)sicut)?\b//i)
941 {
942 0 ▶ if ($4)
Branch: 1 branch
BranchTrueFalseTotal
if ($4) { } 0 0 0
943 {
944 0 ▶ my $token = $3 ? $1.$3 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$3 ? : 0 0 0
945 0 push @tokens, token($token,'NAME',$token,'Name');
946 }
947 else
948 {
949 0 ▶ push @tokens, tokdup $connectives{lc $3} if $3;
Branch: 1 branch
BranchTrueFalseTotal
if $3 0 0 0
950 0 push @tokens, token($1,'ACCUSATIVE',"\\&$2",'Literal');
951 }
952 }
953 elsif ($text =~ s/\A([.])//)
954 {
955 11 push @tokens, token($1,'PERIOD',";",'Separator');
956 }
957 elsif ($text =~ s/\A(\S+)(que|ve|)((?:\s+)sicut)?\b//)
958 {
959 2 ▶ if ($3)
Branch: 1 branch
BranchTrueFalseTotal
if ($3) { } 0 2 2
960 {
961 0 ▶ my $token = $2 ? $1.$2 : $1;
Branch: 1 branch
BranchTrueFalseTotal
$2 ? : 0 0 0
962 0 ▶ push @tokens, token($token,'NAME',$token,'Name') if $token;
Branch: 1 branch
BranchTrueFalseTotal
if $token 0 0 0
963 }
964 else
965 {
966 2 ▶ push @tokens, tokdup $connectives{lc $2} if $2;
Branch: 1 branch
BranchTrueFalseTotal
if $2 0 2 2
967 2 ▶ push @tokens, token($1,'NAME',"$1",'Name') if $1;
Branch: 1 branch
BranchTrueFalseTotal
if $1 2 0 2
968 }
969 }
970 else
971 {
972 3 ▶ $text =~ s/\A(\S+)// or next;
Branch: 1 branch
BranchTrueFalseTotal
$text =~ s/\A(\S+)// or next 3 0 3
973 0 my $error = $1;
974 0 $bad .= "Aliquod barbarum inveni: '$error'"
975 . adversum({line=>$line});
976 }
977 122 ▶ $tokens[-1]->{line} = $line if @tokens;
Branch: 1 branch
BranchTrueFalseTotal
if @tokens 122 0 122
978 }
979 6 ▶ if (($lex ||$debug) && @tokens) {
Branch: 1 branch
BranchTrueFalseTotal
if ($lex || $debug and @tokens) 0 6 6
Condition33%2/6
$lex || $debug and @tokens
!ll&&!rl&&r
600
$lex or $debug
l!l&&r!l&&!r
006
MC/DC0%0/3
$lex || $debug and @tokens
$lex $debug @tokens
Truth table20%1/5
A or B and C
A= $lexB= $debugC= @tokens
ABCresult
00X0
1X00
0100
1X11
0111
980 0 my $format = "%-20s %-10s %-20s\n";
981 0 printf $format, qw(Word Role Meaning);
982 0 printf $format, qw(==== ==== =======);
983 0 foreach ( @tokens ) {
984 0 printf $format, @{$_}{qw(raw lex perl)};
985 }
986 0 print "\n", "="x72, "\n\n";
987 0 ▶ die "\n" if $lex;
Branch: 1 branch
BranchTrueFalseTotal
if $lex 0 0 0
988 }
989  
990 6 ▶ die $bad if $bad;
Branch: 1 branch
BranchTrueFalseTotal
if $bad 0 6 6
991 6 return [@tokens];
992 }
993  
994 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
995  
996 sub conn_command {
997 21 ▶ my ($toks, $eatend, $noeatend) = @_;
Subroutine conn_command: called CC=3 SCAR=13.6
Pod undocumented
998 21 my $command = &command;
999 21 ▶ while (@$toks && $toks->[0]{lex} eq 'CONNECTIVE') {
Branch: 1 branch
BranchTrueFalseTotal
if (@$toks and $toks->[0]{"lex"} eq "CONNECTIVE") 0 21 21
Condition66%2/3
@$toks and $toks->[0]{"lex"} eq "CONNECTIVE"
!ll&&!rl&&r
3180
MC/DC0%0/2
@$toks and $toks->[0]{"lex"} eq "CONNECTIVE"
@$toks $toks->[0]{"lex"} eq "CONNECTIVE"
Truth table66%2/3
A and B
A= @$toksB= $toks->[0]{"lex"} eq "CONNECTIVE"
ABresult
0X0
100
111
1000 0 local $Lingua::Romana::Perligata::connective = shift @$toks;
1001 0 $connective->{L} = $command;
1002 0 $connective->{R} = &command;
1003 0 $command = $connective;
1004 }
1005 21 return $command;
1006 }
1007  
1008  
1009 sub command {
1010 21 ▶ my ($toks, $eatend, $noeatend) = @_;
Subroutine command: called CC=71 SCAR=59.1
Pod undocumented
1011 21 my @Astack = { data => [], complete => 1 }; #SENTINEL ACCUSATIVE FRAME
1012 21 my (@Bstack, @Dstack, @Vstack, $Vdone);
1013 21 my $Dindir = 0;
1014 21 my @lastsubstantive;
1015 21 my $empty = 1;
1016  
1017 21 my $reduce;
1018 my $Astack_push = sub {
1019 39 ▶ if ($Astack[-1]{complete}) {
Subroutine __ANON__: called CC=3 SCAR=11.0
Branch: 1 branch
BranchTrueFalseTotal
if ($Astack[-1]{'complete'}) { } 16 23 39
1020 16 ▶ $reduce->($_[0]) if @Astack > 1;
Branch: 1 branch
BranchTrueFalseTotal
if @Astack > 1 0 16 16
1021 16 push @Astack, { data => [ $_[0] ] };
1022 }
1023 else {
1024 23 push @{$Astack[-1]{data}}, $_[0];
1025 }
1026 39 $Astack[-1]{complete} = 1;
1027 21 };
1028  
1029 $reduce = sub {
1030 57 ▶ my ($lookahead) = @_;
Subroutine __ANON__: called CC=33 SCAR=42.7
1031 57 ▶ if (! @Vstack) {
Branch: 1 branch
BranchTrueFalseTotal
unless (@Vstack) 30 27 57
1032 30 ▶ if (@Dstack && ($Dstack[-1]{V}{lex}||"") eq 'OWNER_D') {
Branch: 1 branch
BranchTrueFalseTotal
if (@Dstack and ($Dstack[-1]{"V"}{"lex"} || "") eq "OWNER_D") 0 30 30
Condition80%4/5
@Dstack and ($Dstack[-1]{"V"}{"lex"} || "") eq "OWNER_D"
!ll&&!rl&&r
2640
$Dstack[-1]{'V'}{'lex'} || ''
l!l
22
MC/DC100%2/2
@Dstack and ($Dstack[-1]{"V"}{"lex"} || "") eq "OWNER_D"
@Dstack $Dstack[-1]{'V'}{'lex'}
Truth table100%3/3
A and B
A= @DstackB= $Dstack[-1]{'V'}{'lex'}
ABresult
0X0
100
111
1033 0 $Vdone = pop @Dstack;
1034 0 return 1
1035 }
1036 30 return 0;
1037 }
1038 27 ▶ return 0 if $Vstack[-1]{lex} =~ /^SUBNAME_?A?D?$/ && $lookahead->{lex} !~ /PERIOD|DO|END|CONNECTIVE/
Branch: 1 branch
BranchTrueFalseTotal
if $Vstack[-1]{"lex"} =~ /^SUBNAME_?A?D?$/ and not $lookahead->{"lex"} =~ /PERIOD|DO|END|CONNECTIVE/ or ref $Vstack[-1] eq "STATEMENT" 10 17 27
Condition83%5/6
$Vstack[-1]{"lex"} =~ /^SUBNAME_?A?D?$/ and not $lookahead->{"lex"} =~ /PERIOD|DO|END|CONNECTIVE/ or ref $Vstack[-1] eq "STATEMENT"
l!l&&r!l&&!r
10017
$Vstack[-1]{"lex"} =~ /^SUBNAME_?A?D?$/ and not $lookahead->{"lex"} =~ /PERIOD|DO|END|CONNECTIVE/
!ll&&!rl&&r
8910
MC/DC66%2/3
$Vstack[-1]{"lex"} =~ /^SUBNAME_?A?D?$/ and not $lookahead->{"lex"} =~ /PERIOD|DO|END|CONNECTIVE/ or ref $Vstack[-1] eq "STATEMENT"
$Vstack[-1]{"lex"} =~ /^SUBNAME_?A?D?$/ not $lookahead->{"lex"} =~ /PERIOD|DO|END|CONNECTIVE/ ref $Vstack[-1] eq "STATEMENT"
Truth table60%3/5
A and not(B) or C
A= $Vstack[-1]{"lex"} =~ /^SUBNAME_?A?D?$/B= not $lookahead->{"lex"} =~ /PERIOD|DO|END|CONNECTIVE/C= ref $Vstack[-1] eq "STATEMENT"
ABCresult
11X1
0X11
1011
0X00
1000
1039 || ref $Vstack[-1] eq "STATEMENT";
1040 17 my $verb = $Vstack[-1];
1041 17 my ($needA, $needD) = $verb->{lex} =~ /_(O?A?)([BD])?/;
1042 17 ▶ $needA ||= $verb->{lex} eq 'SUBNAME' ? "OA" : "";
Branch: 1 branch
BranchTrueFalseTotal
$verb->{'lex'} eq 'SUBNAME' ? : 2 3 5
Condition100%3/3
$needA ||= $verb->{"lex"} eq "SUBNAME" ? "OA" : ""
l!l&&r!l&&!r
1223
MC/DC100%2/2
$needA ||= $verb->{"lex"} eq "SUBNAME" ? "OA" : ""
$needA $verb->{"lex"} eq "SUBNAME" ? "OA" : ""
Truth table100%3/3
A ||= B
A= $needAB= $verb->{"lex"} eq "SUBNAME" ? "OA" : ""
ABresult
1X1
011
000
1043 17 ▶ $needD ||= "";
Condition100%2/2
$needD ||= ""
l!l
107
MC/DC100%1/1
$needD ||= ""
$needD
Truth table100%2/2
A
A= $needD
Aresult
11
00
1044 return 0 if $needA && $needA ne "OA" && (@Astack<=1 || !$Astack[-1]{complete})
1045 17 ▶ || $needD eq 'D' && !@Dstack
Branch: 1 branch
BranchTrueFalseTotal
if $needA and $needA ne "OA" and @Astack <= 1 || !$Astack[-1]{"complete"} or $needD eq "D" and not @Dstack or $needD eq "B" and not @Bstack 1 16 17
Condition66%14/21
$needA and $needA ne "OA" and @Astack <= 1 || !$Astack[-1]{"complete"} or $needD eq "D" and not @Dstack or $needD eq "B" and not @Bstack
l!l&&r!l&&!r
1016
$needA and $needA ne "OA" and @Astack <= 1 || !$Astack[-1]{"complete"} or $needD eq "D" and not @Dstack
l!l&&r!l&&!r
0116
$needA and $needA ne "OA" and @Astack <= 1 || !$Astack[-1]{"complete"}
!ll&&!rl&&r
5120
$needA and $needA ne "OA"
!ll&&!rl&&r
3212
@Astack <= 1 or not $Astack[-1]{"complete"}
l!l&&r!l&&!r
0012
$needD eq "D" and not @Dstack
!ll&&!rl&&r
791
$needD eq "B" and not @Bstack
!ll&&!rl&&r
1600
MC/DC0%0/8
$needA and $needA ne "OA" and @Astack <= 1 || !$Astack[-1]{"complete"} or $needD eq "D" and not @Dstack or $needD eq "B" and not @Bstack
$needA $needA ne "OA" @Astack <= 1 not $Astack[-1]{"complete"} $needD eq "D" not @Dstack $needD eq "B" not @Bstack
Truth table4%1/23
A and B and C or not(D) or E and not(F) or G and not(H)
A= $needAB= $needA ne "OA"C= @Astack <= 1D= not $Astack[-1]{"complete"}E= $needD eq "D"F= not @DstackG= $needD eq "B"H= not @Bstack
ABCDEFGHresult
111XXXXX1
1101XXXX1
0XXX11XX1
10XX11XX1
110011XX1
0XXX0X111
0XXX10111
10XX0X111
10XX10111
11000X111
110010111
0XXX0X0X0
0XXX0X100
0XXX100X0
0XXX10100
10XX0X0X0
10XX0X100
10XX100X0
10XX10100
11000X0X0
11000X100
1100100X0
110010100
1046 || $needD eq 'B' && !@Bstack;
1047 16 ▶ my $dat = $needD eq 'D' ? pop(@Dstack)
Branch: 2 branches
BranchTrueFalseTotal
$needD eq 'D' ? : 9 7 16
$needD eq 'B' ? : 0 7 7
1048 : $needD eq 'B' ? pop(@Bstack)
1049 : undef;
1050 16 ▶ my $acc = $needA && @Astack>1 ? pop(@Astack)->{data} : undef;
Branch: 1 branch
BranchTrueFalseTotal
$needA && @Astack > 1 ? : 14 2 16
Condition66%2/3
$needA and @Astack > 1
!ll&&!rl&&r
2014
MC/DC50%1/2
$needA and @Astack > 1
$needA @Astack > 1
Truth table66%2/3
A and B
A= $needAB= @Astack > 1
ABresult
0X0
100
111
1051 16 my $statement = bless { V=>pop(@Vstack), A=>$acc, D=>$dat }, "STATEMENT";
1052 16 ▶ if ($verb->{lex} =~ /SUBNAME_.*_ACCUSATIVE/
Branch: 3 branches
BranchTrueFalseTotal
if ($verb->{'lex'} =~ /SUBNAME_.*_ACCUSATIVE/ or $Dindir and $verb->{'lex'} =~ /SUBNAME_.*_DATIVE|OWNER_D/) { } 4 12 16
elsif ($verb->{'lex'} =~ /SUBNAME_.*_DATIVE|OWNER_D/) { } 3 9 12
elsif ($verb->{'lex'} =~ /SUBNAME_.*_GENITIVE/) { } 0 9 9
Condition50%3/6
$verb->{"lex"} =~ /SUBNAME_.*_ACCUSATIVE/ or $Dindir and $verb->{"lex"} =~ /SUBNAME_.*_DATIVE|OWNER_D/
l!l&&r!l&&!r
4012
$Dindir and $verb->{"lex"} =~ /SUBNAME_.*_DATIVE|OWNER_D/
!ll&&!rl&&r
1200
MC/DC33%1/3
$verb->{"lex"} =~ /SUBNAME_.*_ACCUSATIVE/ or $Dindir and $verb->{"lex"} =~ /SUBNAME_.*_DATIVE|OWNER_D/
$verb->{"lex"} =~ /SUBNAME_.*_ACCUSATIVE/ $Dindir $verb->{"lex"} =~ /SUBNAME_.*_DATIVE|OWNER_D/
Truth table50%2/4
A or B and C
A= $verb->{"lex"} =~ /SUBNAME_.*_ACCUSATIVE/B= $DindirC= $verb->{"lex"} =~ /SUBNAME_.*_DATIVE|OWNER_D/
ABCresult
1XX1
0111
00X0
0100
1053 || $Dindir && $verb->{lex} =~ /SUBNAME_.*_DATIVE|OWNER_D/ )
1054 {
1055 4 ▶ if ($verb->{lex} =~ /SUBNAME_.*_DATIVE|OWNER_D/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($verb->{"lex"} =~ /SUBNAME_.*_DATIVE|OWNER_D/) 0 4 4
1056 0 $statement->{R} = $Dindir;
1057 0 $Dindir = 0;
1058 }
1059 4 $Astack_push->($statement);
1060 4 push @lastsubstantive, $Astack[-1]{data};
1061 }
1062 elsif ($verb->{lex} =~ /SUBNAME_.*_DATIVE|OWNER_D/ ) {
1063 3 push @Dstack, $statement;
1064 3 push @lastsubstantive, \@Dstack;
1065 }
1066 elsif ($verb->{lex} =~ /SUBNAME_.*_GENITIVE/ ) {
1067 0 my $lastsubstantive = pop @lastsubstantive;
1068 0 ▶ die "Genitivum non junctum: '$ord->{raw}'"
Branch: 1 branch
BranchTrueFalseTotal
unless $lastsubstantive 0 0 0
1069 . adversum($verb)
1070 unless $lastsubstantive;
1071 0 $ord = $lastsubstantive[-1][-1];
1072 die "Index '$ord->{raw}' ordinalis non est"
1073 . adversum($ord)
1074 0 ▶ if $ord->{lex} && $ord->{lex} eq 'NUMERAL';
Branch: 1 branch
BranchTrueFalseTotal
if $ord->{"lex"} and $ord->{"lex"} eq "NUMERAL" 0 0 0
Condition0%0/3
$ord->{"lex"} and $ord->{"lex"} eq "NUMERAL"
!ll&&!rl&&r
000
MC/DC0%0/2
$ord->{"lex"} and $ord->{"lex"} eq "NUMERAL"
$ord->{"lex"} $ord->{"lex"} eq "NUMERAL"
Truth table0%0/3
A and B
A= $ord->{"lex"}B= $ord->{"lex"} eq "NUMERAL"
ABresult
0X0
100
111
1075 0 push @{$ord->{G}}, $statement;
1076 0 push @lastsubstantive, $Astack[-1]{data};
1077 }
1078 9 else { $Vdone = $statement }
1079 16 ▶ if ($debug) {
Branch: 1 branch
BranchTrueFalseTotal
if ($debug) 0 16 16
1080 0 print "reduced: ", Data::Dumper->Dump([$statement]);
1081 }
1082 16 return 1;
1083 21 };
1084  
1085 21 my $tok;
1086 21 ▶ while ( $tok = $toks->[0] ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tok = $toks->[0]) 106 0 106
1087 106 ▶ if ($debug) {
Branch: 1 branch
BranchTrueFalseTotal
if ($debug) 0 106 106
1088 0 print "Next: '$toks->[0]{raw}' ($toks->[0]{lex}):\n";
1089 }
1090 106 ▶ if ($tok->{lex} =~ /^(NUMERAL|ORDINAL)$/
Branch: 20 branches
BranchTrueFalseTotal
if ($tok->{'lex'} =~ /^(NUMERAL|ORDINAL)$/ or $Dindir and $tok->{'lex'} eq 'ORDINAL_DATIVE') { } 11 95 106
elsif ($tok->{'lex'} eq 'ORDINAL_DATIVE') { } 0 95 95
elsif ($tok->{'lex'} eq 'WITH') { } 0 95 95
elsif ($tok->{'lex'} =~ /^(?:ACCUSATIVE|NAME)$/ or $Dindir and $tok->{'lex'} eq 'DATIVE') { } 24 71 95
elsif ($tok->{'lex'} eq 'ARROW') { } 0 71 71
elsif ($tok->{'lex'} eq 'WITHIN') { } 0 71 71
elsif ($tok->{'lex'} eq 'GENITIVE') { } 3 68 71
elsif ($tok->{'lex'} eq 'INFINITIVE') { } 2 66 68
elsif ($tok->{'lex'} eq 'CONTROL') { } 2 64 66
elsif ($tok->{'lex'} eq 'FOR') { } 2 62 64
elsif ($tok->{'lex'} eq 'BEGIN') { } 0 62 62
elsif ($tok->{'lex'} eq 'OWNER_D') { } 1 61 62
elsif ($tok->{'lex'} eq 'COMMA') { } 23 38 61
elsif ($tok->{'lex'} eq 'ADDRESS') { } 0 38 38
elsif ($tok->{'lex'} eq 'DATIVE') { } 8 30 38
elsif ($tok->{'lex'} =~ /^SUBNAME/) { } 15 15 30
elsif ($tok->{'lex'} =~ /PERIOD/) { } 11 4 15
elsif ($tok->{'lex'} =~ /CONNECTIVE/) { } 0 4 4
elsif ($eatend and $tok->{'lex'} =~ /$eatend/) { } 4 0 4
elsif ($noeatend and $tok->{'lex'} =~ /$noeatend/) { } 0 0 0
Condition50%3/6
$tok->{"lex"} =~ /^(NUMERAL|ORDINAL)$/ or $Dindir and $tok->{"lex"} eq "ORDINAL_DATIVE"
l!l&&r!l&&!r
11095
$Dindir and $tok->{"lex"} eq "ORDINAL_DATIVE"
!ll&&!rl&&r
9500
MC/DC33%1/3
$tok->{"lex"} =~ /^(NUMERAL|ORDINAL)$/ or $Dindir and $tok->{"lex"} eq "ORDINAL_DATIVE"
$tok->{"lex"} =~ /^(NUMERAL|ORDINAL)$/ $Dindir $tok->{"lex"} eq "ORDINAL_DATIVE"
Truth table50%2/4
A or B and C
A= $tok->{"lex"} =~ /^(NUMERAL|ORDINAL)$/B= $DindirC= $tok->{"lex"} eq "ORDINAL_DATIVE"
ABCresult
1XX1
0111
00X0
0100
1091 || $Dindir && $tok->{lex} eq 'ORDINAL_DATIVE')
1092 11 { shift @$toks;
1093 11 ▶ if ($1 eq 'NUMERAL' && $toks->[0]{lex} eq 'ORDINAL') {
Branch: 1 branch
BranchTrueFalseTotal
if ($1 eq "NUMERAL" and $toks->[0]{"lex"} eq "ORDINAL") 0 11 11
Condition66%2/3
$1 eq "NUMERAL" and $toks->[0]{"lex"} eq "ORDINAL"
!ll&&!rl&&r
380
MC/DC0%0/2
$1 eq "NUMERAL" and $toks->[0]{"lex"} eq "ORDINAL"
$1 eq "NUMERAL" $toks->[0]{"lex"} eq "ORDINAL"
Truth table66%2/3
A and B
A= $1 eq "NUMERAL"B= $toks->[0]{"lex"} eq "ORDINAL"
ABresult
0X0
100
111
1094 0 $tok->{raw} .= " " . $toks->[0]{raw};
1095 0 $tok->{perl} /= $toks->[0]{perl};
1096 0 shift @$toks;
1097 }
1098 11 ▶ if ($tok->{lex} eq 'ORDINAL_DATIVE') {
Branch: 1 branch
BranchTrueFalseTotal
if ($tok->{"lex"} eq "ORDINAL_DATIVE") 0 11 11
1099 0 $tok->{R} = $Dindir;
1100 0 $Dindir = 0;
1101 }
1102 11 $Astack_push->($tok);
1103 11 $lastownable = $Astack[-1]{data};
1104 11 push @lastsubstantive, $lastownable;
1105 }
1106 elsif ($tok->{lex} eq 'ORDINAL_DATIVE')
1107 0 { shift @$toks;
1108 0 $reduce->($tok);
1109 0 push @Dstack, $tok;
1110 0 $lastownable = \@Dstack;
1111 0 push @lastsubstantive, $lastownable;
1112 }
1113 elsif ($tok->{lex} eq 'WITH') {
1114 0 push @Astack, { data=>[], complete=>0 };
1115 0 shift @$toks;
1116 }
1117 ▶ elsif ($tok->{lex} =~ /^(?:ACCUSATIVE|NAME)$/
Condition50%3/6
$tok->{"lex"} =~ /^(?:ACCUSATIVE|NAME)$/ or $Dindir and $tok->{"lex"} eq "DATIVE"
l!l&&r!l&&!r
24071
$Dindir and $tok->{"lex"} eq "DATIVE"
!ll&&!rl&&r
7100
MC/DC33%1/3
$tok->{"lex"} =~ /^(?:ACCUSATIVE|NAME)$/ or $Dindir and $tok->{"lex"} eq "DATIVE"
$tok->{"lex"} =~ /^(?:ACCUSATIVE|NAME)$/ $Dindir $tok->{"lex"} eq "DATIVE"
Truth table50%2/4
A or B and C
A= $tok->{"lex"} =~ /^(?:ACCUSATIVE|NAME)$/B= $DindirC= $tok->{"lex"} eq "DATIVE"
ABCresult
1XX1
0111
00X0
0100
1118 || $Dindir && $tok->{lex} eq 'DATIVE')
1119 24 ▶ { if ($tok->{lex} eq 'DATIVE') {
Branch: 1 branch
BranchTrueFalseTotal
if ($tok->{"lex"} eq "DATIVE") 0 24 24
1120 0 $tok->{R} = $Dindir;
1121 0 $Dindir = 0;
1122 }
1123 24 $Astack_push->($tok);
1124 24 shift @$toks;
1125 24 $lastownable = $Astack[-1]{data};
1126 24 push @lastsubstantive, $lastownable;
1127 }
1128 elsif ( $tok->{lex} eq 'ARROW' ) {
1129 0 my $owner = $toks->[1];
1130 my $perl = $owner->{perl} =~ /^\W/
1131 ? $owner->{perl}
1132 0 ▶ : "$owner->{raw}::";
Branch: 1 branch
BranchTrueFalseTotal
$owner->{'perl'} =~ /^\W/ ? : 0 0 0
1133 $lastownable->[-1]->{perl}
1134 0 =~ s{^}{$perl->};
1135 0 splice @$toks, 0, 2;
1136 }
1137 elsif ( $tok->{lex} eq 'WITHIN' ) {
1138 0 my $owner = $toks->[1];
1139 $lastownable->[-1]->{raw}
1140 0 =~ s{^(\W*)}{$1$owner->{raw}::};
1141 $lastownable->[-1]->{perl}
1142 0 =~ s{^(\W*)}{$1$owner->{raw}::};
1143 0 splice @$toks, 0, 2;
1144 }
1145 elsif ( $tok->{lex} eq 'GENITIVE' ) {
1146 3 $reduce->($tok);
1147 3 my $gen = shift @$toks;
1148 3 ▶ die "Genitivum indominum: '$ord->{raw}'"
Branch: 1 branch
BranchTrueFalseTotal
unless @lastsubstantive 0 3 3
1149 . adversum($gen)
1150 unless @lastsubstantive;
1151 3 $ord = $lastsubstantive[-1][-1];
1152 die "Index '$ord->{raw}' ordinalis non est"
1153 . adversum($ord)
1154 3 ▶ if $ord->{lex} && $ord->{lex} eq 'NUMERAL';
Branch: 1 branch
BranchTrueFalseTotal
if $ord->{"lex"} and $ord->{"lex"} eq "NUMERAL" 0 3 3
Condition33%1/3
$ord->{"lex"} and $ord->{"lex"} eq "NUMERAL"
!ll&&!rl&&r
030
MC/DC0%0/2
$ord->{"lex"} and $ord->{"lex"} eq "NUMERAL"
$ord->{"lex"} $ord->{"lex"} eq "NUMERAL"
Truth table33%1/3
A and B
A= $ord->{"lex"}B= $ord->{"lex"} eq "NUMERAL"
ABresult
0X0
100
111
1155 3 push @{$ord->{G}}, $gen;
1156 3 $lastownable = $ord->{G};
1157 }
1158 elsif ( $tok->{lex} eq 'INFINITIVE' )
1159 2 { $reduce->($tok); $Vdone = subdefn($toks); last }
1160 elsif ( $tok->{lex} eq 'CONTROL' )
1161 2 { $reduce->($tok); $Vdone = control($toks, \@Bstack); last }
1162 elsif ( $tok->{lex} eq 'FOR' )
1163 2 { $reduce->($tok); $Vdone = for_control($toks, \@Bstack); last }
1164 elsif ( $tok->{lex} eq 'BEGIN' )
1165 0 { push @Bstack, block($toks) }
1166 elsif ( $tok->{lex} eq 'OWNER_D' )
1167 1 { $reduce->($tok); push @Vstack, $tok; shift @$toks; }
1168 elsif ( $tok->{lex} eq 'COMMA' )
1169 { $reduce->($tok)
1170 unless $lastownable && @Astack>1 &&
1171 23 ▶ $lastownable == $Astack[-1]{data};
Branch: 1 branch
BranchTrueFalseTotal
unless $lastownable and @Astack > 1 and $lastownable == $Astack[-1]{"data"} 4 19 23
Condition83%5/6
$lastownable and @Astack > 1 and $lastownable == $Astack[-1]{"data"}
!ll&&!rl&&r
1319
$lastownable and @Astack > 1
!ll&&!rl&&r
0122
MC/DC66%2/3
$lastownable and @Astack > 1 and $lastownable == $Astack[-1]{"data"}
$lastownable @Astack > 1 $lastownable == $Astack[-1]{"data"}
Truth table75%3/4
A and B and C
A= $lastownableB= @Astack > 1C= $lastownable == $Astack[-1]{"data"}
ABCresult
0XX0
10X0
1100
1111
1172 die "'$tok->{raw}' immaturum est " . adversum($tok)
1173 23 ▶ unless @Astack>1 && $Astack[-1]{complete};
Branch: 1 branch
BranchTrueFalseTotal
unless @Astack > 1 and $Astack[-1]{"complete"} 0 23 23
Condition33%1/3
@Astack > 1 and $Astack[-1]{"complete"}
!ll&&!rl&&r
0023
MC/DC0%0/2
@Astack > 1 and $Astack[-1]{"complete"}
@Astack > 1 $Astack[-1]{"complete"}
Truth table33%1/3
A and B
A= @Astack > 1B= $Astack[-1]{"complete"}
ABresult
0X0
100
111
1174 23 $Astack[-1]{complete} = 0;
1175 23 shift @$toks;
1176 }
1177 elsif ( $tok->{lex} eq 'ADDRESS' )
1178 0 { $reduce->($tok);
1179 0 $Dindir++;
1180 0 shift @$toks;
1181 }
1182 elsif ( $tok->{lex} eq 'DATIVE' )
1183 8 { $reduce->($tok); push @Dstack, $tok; shift @$toks;
1184 8 $lastownable = \@Dstack;
1185 8 push @lastsubstantive, $lastownable;
1186 }
1187 elsif ( $tok->{lex} =~ /^SUBNAME/ ) # WAS: /SUBNAME_
1188 15 ▶ { if ($Astack[-1]{complete}) {
Branch: 2 branches
BranchTrueFalseTotal
if ($Astack[-1]{'complete'}) { } 15 0 15
elsif (not $tok->{'perl'} =~ /^(and|or|[&|]{2})$/) { } 0 0 0
1189 15 $reduce->($tok)
1190 }
1191 elsif ($tok->{perl} !~ /^(and|or|[&|]{2})$/) {
1192 0 push @Astack, { data=>[] };
1193 }
1194 15 push @Vstack, $tok; shift @$toks;
1195 15 $lastownable = \@Vstack;
1196 }
1197 # elsif ( $tok->{lex} =~ /^SUBNAME$/ )
1198 # { if ($Astack[-1]{complete}) {
1199 # $reduce->($tok)
1200 # }
1201 # elsif ($tok->{perl} !~ /^[&|]{2}$/ {
1202 # push @Astack, { data=>[] };
1203 # }
1204 # push @Vstack, $tok; shift @$toks;
1205 # $lastownable = \@Vstack;
1206 # }
1207 elsif ( $tok->{lex} =~ /PERIOD/ )
1208 11 ▶ { 1 while $reduce->($tok) && !$Vdone;
Branch: 1 branch
BranchTrueFalseTotal
&$reduce($tok) and not $Vdone and do { '???' } 1 11 12
Condition100%3/3
&$reduce($tok) and not $Vdone
!ll&&!rl&&r
291
MC/DC100%2/2
&$reduce($tok) and not $Vdone
&$reduce($tok) not $Vdone
Truth table100%3/3
A and not(B)
A= &$reduce($tok)B= not $Vdone
ABresult
0X0
100
111
1209 $Vdone = pop(@Astack)->{data}
1210 11 ▶ if $Lingua::Romana::Perligata::connective
Branch: 1 branch
BranchTrueFalseTotal
if $connective and not $Vdone || @Astack <= 1 0 11 11
Condition16%1/6
$connective and not $Vdone || @Astack <= 1
!ll&&!rl&&r
1100
$Vdone || @Astack <= 1
l!l&&r!l&&!r
000
MC/DC0%0/3
$connective and not $Vdone || @Astack <= 1
$connective $Vdone @Astack <= 1
Truth table25%1/4
A and not(B || C)
A= $connectiveB= $VdoneC= @Astack <= 1
ABCresult
0XX0
11X0
1010
1001
1211 && !($Vdone || @Astack <= 1);
1212 11 shift @$toks;
1213 last
1214 11 }
1215 elsif ( $tok->{lex} =~ /CONNECTIVE/ )
1216 0 ▶ { 1 while $reduce->($tok) && !$Vdone;
Branch: 1 branch
BranchTrueFalseTotal
&$reduce($tok) and not $Vdone and do { '???' } 0 0 0
Condition0%0/3
&$reduce($tok) and not $Vdone
!ll&&!rl&&r
000
MC/DC0%0/2
&$reduce($tok) and not $Vdone
&$reduce($tok) not $Vdone
Truth table0%0/3
A and not(B)
A= &$reduce($tok)B= not $Vdone
ABresult
0X0
100
111
1217 $Vdone = pop(@Astack)->{data}
1218 0 ▶ unless $Vdone || @Astack <= 1;
Branch: 1 branch
BranchTrueFalseTotal
unless $Vdone or @Astack <= 1 0 0 0
Condition0%0/3
$Vdone or @Astack <= 1
l!l&&r!l&&!r
000
MC/DC0%0/2
$Vdone or @Astack <= 1
$Vdone @Astack <= 1
Truth table0%0/3
A or B
A= $VdoneB= @Astack <= 1
ABresult
1X1
011
000
1219 0 last }
1220 ▶ elsif ( $eatend && $tok->{lex} =~ /$eatend/ )
Condition33%1/3
$eatend and $tok->{"lex"} =~ /$eatend/
!ll&&!rl&&r
004
MC/DC0%0/2
$eatend and $tok->{"lex"} =~ /$eatend/
$eatend $tok->{"lex"} =~ /$eatend/
Truth table33%1/3
A and B
A= $eatendB= $tok->{"lex"} =~ /$eatend/
ABresult
0X0
100
111
1221 4 ▶ { 1 while $reduce->($tok);
Branch: 1 branch
BranchTrueFalseTotal
&$reduce($tok) and do { '???' } 4 4 8
1222 $Vdone or $Vdone = @Astack > 1
1223 ? pop(@Astack)->{data}
1224 4 ▶ : pop @Dstack;
Branch: 2 branches
BranchTrueFalseTotal
$Vdone or $Vdone = @Astack > 1 ? pop(@Astack)->{"data"} : pop @Dstack 4 0 4
@Astack > 1 ? : 2 2 4
1225 4 shift @$toks; last }
1226 ▶ elsif ( $noeatend && $tok->{lex} =~ /$noeatend/ )
Condition0%0/3
$noeatend and $tok->{"lex"} =~ /$noeatend/
!ll&&!rl&&r
000
MC/DC0%0/2
$noeatend and $tok->{"lex"} =~ /$noeatend/
$noeatend $tok->{"lex"} =~ /$noeatend/
Truth table0%0/3
A and B
A= $noeatendB= $tok->{"lex"} =~ /$noeatend/
ABresult
0X0
100
111
1227 0 ▶ { 1 while $reduce->($tok);
Branch: 1 branch
BranchTrueFalseTotal
&$reduce($tok) and do { '???' } 0 0 0
1228 $Vdone or $Vdone = pop(@Astack)->{data}
1229 0 ▶ || pop @Dstack;
Branch: 1 branch
BranchTrueFalseTotal
$Vdone or $Vdone = pop(@Astack)->{"data"} || pop @Dstack 0 0 0
Condition0%0/3
pop(@Astack)->{'data'} || pop @Dstack
l!l&&r!l&&!r
000
MC/DC0%0/2
pop(@Astack)->{'data'} || pop @Dstack
pop(@Astack)->{'data'} pop @Dstack
Truth table0%0/3
A || B
A= pop(@Astack)->{'data'}B= pop @Dstack
ABresult
1X1
011
000
1230 0 last }
1231 else {
1232 0 die "Non intellexi: '$tok->{raw}'" . adversum($tok);
1233 }
1234 }
1235 continue {
1236 85 $empty = 0;
1237 85 ▶ if ($debug) {
Branch: 1 branch
BranchTrueFalseTotal
if ($debug) 0 85 85
1238 0 print "After '$tok->{raw}' ($tok->{lex}):\n";
1239 0 print Data::Dumper->Dump([\@Vstack, \@Astack, \@Bstack, \@Dstack, \@lastsubstantive, \$lastownable, \$Vdone], [qw{Vstack Astack Bstack Dstack LastS LastO Vdone}]);
1240 }
1241 }
1242 die "Iussum nefastum: '$Vstack[-1]{raw}'" . adversum($Vstack[-1])
1243 21 ▶ . ( $Vstack[-1]{lex} !~ /(ACCUSATIVE|DATIVE)$/
Branch: 2 branches
BranchTrueFalseTotal
if $Vdone and @Vstack 0 21 21
!($Vstack[-1]{'lex'} =~ /(ACCUSATIVE|DATIVE)$/) ? : 0 0 0
Condition66%2/3
$Vdone and @Vstack
!ll&&!rl&&r
2190
MC/DC0%0/2
$Vdone and @Vstack
$Vdone @Vstack
Truth table66%2/3
A and B
A= $VdoneB= @Vstack
ABresult
0X0
100
111
1244 ? "(Vellesne '$Vstack[-1]{raw}mentum' unumve ceteri)\n"
1245 : "" )
1246 if $Vdone && @Vstack;
1247 die "Accusativum non junctum: '"
1248 0 . join(" tum ", map {$_->{raw}} @{$Astack[-1]{data}})
1249 . "'"
1250 21 ▶ . adversum($Astack[-1]{data}[0])
Branch: 1 branch
BranchTrueFalseTotal
if @Astack > 1 and not @Vstack 0 21 21
Condition33%1/3
@Astack > 1 and not @Vstack
!ll&&!rl&&r
2100
MC/DC0%0/2
@Astack > 1 and not @Vstack
@Astack > 1 not @Vstack
Truth table33%1/3
A and not(B)
A= @Astack > 1B= not @Vstack
ABresult
0X0
100
111
1251 if @Astack > 1 && !@Vstack;
1252 21 ▶ die "Dativum non junctum: '$Dstack[-1]{raw}'" . adversum($Dstack[-1])
Branch: 1 branch
BranchTrueFalseTotal
if @Dstack and not @Vstack 0 21 21
Condition33%1/3
@Dstack and not @Vstack
!ll&&!rl&&r
2100
MC/DC0%0/2
@Dstack and not @Vstack
@Dstack not @Vstack
Truth table33%1/3
A and not(B)
A= @DstackB= not @Vstack
ABresult
0X0
100
111
1253 if @Dstack && !@Vstack;
1254 21 ▶ die "Sententia imperfecta prope '$tok->{raw}'" . adversum($tok)
Branch: 1 branch
BranchTrueFalseTotal
unless $Vdone or $empty 0 21 21
Condition66%2/3
$Vdone or $empty
l!l&&r!l&&!r
1920
MC/DC0%0/2
$Vdone or $empty
$Vdone $empty
Truth table66%2/3
A or B
A= $VdoneB= $empty
ABresult
1X1
011
000
1255 unless $Vdone || $empty;
1256 21 ▶ return $empty ? $tok
Branch: 2 branches
BranchTrueFalseTotal
$empty ? : 8 13 21
ref $Vdone eq 'ARRAY' ? : 2 11 13
1257 : ref $Vdone eq 'ARRAY' ? $Vdone->[0]
1258 : $Vdone;
1259 }
1260  
1261 sub block
1262 {
1263 6 ▶ my ($toks) = @_;
Subroutine block: called CC=5 SCAR=16.3
Pod undocumented
1264 6 my @self;
1265 6 my $next = shift @$toks;
1266 die "Exspectavi 'sic' sed inveni '$next->{raw}'" . adversum($next)
1267 6 ▶ unless $next->{lex} eq 'BEGIN';
Branch: 1 branch
BranchTrueFalseTotal
unless $next->{"lex"} eq "BEGIN" 0 6 6
1268 6 ▶ while ($toks->[0]{lex} ne 'END') {
Branch: 1 branch
BranchTrueFalseTotal
if ($toks->[0]{"lex"} ne "END") 6 6 12
1269 6 my $command = conn_command($_[0],'PERIOD','END');
1270 6 ▶ push @self, $command if $command;
Branch: 1 branch
BranchTrueFalseTotal
if $command 6 0 6
1271 }
1272 6 $next = shift @$toks;
1273 die "Exspectavi 'cis' sed inveni '$next->{raw}'" . adversum($next)
1274 6 ▶ unless $next->{lex} eq 'END';
Branch: 1 branch
BranchTrueFalseTotal
unless $next->{"lex"} eq "END" 0 6 6
1275 6 return bless \@self, 'BLOCK';
1276 }
1277  
1278 sub subdefn
1279 {
1280 2 ▶ my ($toks) = @_;
Subroutine subdefn: called CC=1 SCAR=0.0
Pod undocumented
1281 2 my $self = shift @$toks;
1282 2 $self->{B} = block($toks);
1283 2 return $self;
1284 }
1285  
1286 sub for_control
1287 {
1288 2 ▶ my ($toks, $Bstack) = @_;
Subroutine for_control: called CC=10 SCAR=32.1
Pod undocumented
1289 2 my $self = shift @$toks;
1290 2 my $var;
1291 $var = $toks->[0]{lex} eq 'ACCUSATIVE'
1292 ? shift @$toks
1293 : $toks->[0]{lex} ne 'IN'
1294 ? die "Exspectavi accusativum post 'per' sed inveni '$toks->[0]{raw}'" . adversum($toks->[0])
1295 2 ▶ : tokdup $tokens{'huic'};
Branch: 2 branches
BranchTrueFalseTotal
$toks->[0]{'lex'} eq 'ACCUSATIVE' ? : 2 0 2
$toks->[0]{'lex'} ne 'IN' ? : 0 0 0
1296 2 my $in = shift @$toks;
1297 die "'in' pro 'per' afuit" . adversum($in)
1298 2 ▶ unless $in->{lex} eq 'IN';
Branch: 1 branch
BranchTrueFalseTotal
unless $in->{"lex"} eq "IN" 0 2 2
1299 2 $self->{D} = $var;
1300 2 $self->{C} = conn_command($toks,'DO', 'PERIOD');
1301 2 ▶ unless (($self->{C}{lex}||$self->{C}{V}{lex}) =~ /DATIVE|OWNER_D/) {
Branch: 1 branch
BranchTrueFalseTotal
unless (($self->{"C"}{"lex"} || $self->{"C"}{"V"}{"lex"}) =~ /DATIVE|OWNER_D/) 0 2 2
Condition33%1/3
$self->{'C'}{'lex'} || $self->{'C'}{'V'}{'lex'}
l!l&&r!l&&!r
020
MC/DC0%0/2
$self->{'C'}{'lex'} || $self->{'C'}{'V'}{'lex'}
$self->{'C'}{'lex'} $self->{'C'}{'V'}{'lex'}
Truth table33%1/3
A || B
A= $self->{'C'}{'lex'}B= $self->{'C'}{'V'}{'lex'}
ABresult
1X1
011
000
1302 my ($badraw, $bad) = $self->{C}{lex}
1303 ? ($self->{C}{raw}, $self->{C})
1304 0 ▶ : ($self->{C}{V}{raw}, $self->{C}{V});
Branch: 1 branch
BranchTrueFalseTotal
$self->{'C'}{'lex'} ? : 0 0 0
1305 0 die "'$badraw' dativus non est in 'per'" . adversum($bad);
1306 }
1307 2 ▶ if ($toks->[0]{lex} =~ /PERIOD|CONNECTIVE/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($toks->[0]{'lex'} =~ /PERIOD|CONNECTIVE/) { } 0 2 2
1308 0 ▶ die "Iussa absentia per '$self->{raw}'" . adversum($self)
Branch: 1 branch
BranchTrueFalseTotal
unless @$Bstack 0 0 0
1309 unless @$Bstack;
1310 0 $self->{B} = pop @$Bstack;
1311 0 ▶ shift @$toks unless $toks->[0]{lex} eq 'CONNECTIVE';
Branch: 1 branch
BranchTrueFalseTotal
unless $toks->[0]{"lex"} eq "CONNECTIVE" 0 0 0
1312 }
1313 else {
1314 2 $self->{B} = block($toks);
1315 }
1316 2 return $self;
1317 }
1318  
1319 sub control
1320 {
1321 2 ▶ my ($toks, $Bstack) = @_;
Subroutine control: called CC=9 SCAR=32.3
Pod documented
1322 2 my $self = shift @$toks;
1323 2 $self->{C} = conn_command($toks,'DO');
1324 2 ▶ if (($self->{perl}||"") eq 'while' &&
Branch: 1 branch
BranchTrueFalseTotal
if (($self->{"perl"} || "") eq "while" and ($self->{"C"}{"V"}{"perl"} || "") eq "Lingua::Romana::Perligata::getline") 0 2 2
Condition28%2/7
($self->{"perl"} || "") eq "while" and ($self->{"C"}{"V"}{"perl"} || "") eq "Lingua::Romana::Perligata::getline"
!ll&&!rl&&r
200
$self->{'perl'} || ''
l!l
20
$self->{'C'}{'V'}{'perl'} || ''
l!l
00
MC/DC0%0/2
($self->{"perl"} || "") eq "while" and ($self->{"C"}{"V"}{"perl"} || "") eq "Lingua::Romana::Perligata::getline"
$self->{'perl'} $self->{'C'}{'V'}{'perl'}
Truth table0%0/3
A and B
A= $self->{'perl'}B= $self->{'C'}{'V'}{'perl'}
ABresult
0X0
100
111
1325 ($self->{C}{V}{perl}||"") eq 'Lingua::Romana::Perligata::getline') {
1326 0 $self->{C}{V}{diamond} = 1;
1327 }
1328 2 ▶ if (!@$toks || $toks->[0]{lex} =~ /PERIOD|CONNECTIVE/) {
Branch: 1 branch
BranchTrueFalseTotal
if (not @$toks or $toks->[0]{'lex'} =~ /PERIOD|CONNECTIVE/) { } 0 2 2
Condition33%1/3
not @$toks or $toks->[0]{"lex"} =~ /PERIOD|CONNECTIVE/
l!l&&r!l&&!r
002
MC/DC0%0/2
not @$toks or $toks->[0]{"lex"} =~ /PERIOD|CONNECTIVE/
not @$toks $toks->[0]{"lex"} =~ /PERIOD|CONNECTIVE/
Truth table33%1/3
not(A) or B
A= not @$toksB= $toks->[0]{"lex"} =~ /PERIOD|CONNECTIVE/
ABresult
1X1
011
000
1329 0 ▶ die "Iussa absentia per '$self->{raw}'" . adversum($self)
Branch: 1 branch
BranchTrueFalseTotal
unless @$Bstack 0 0 0
1330 unless @$Bstack;
1331 0 $self->{B} = pop @$Bstack;
1332 0 ▶ shift @$toks unless $toks->[0]{lex} eq 'CONNECTIVE';
Branch: 1 branch
BranchTrueFalseTotal
unless $toks->[0]{"lex"} eq "CONNECTIVE" 0 0 0
1333 }
1334 else {
1335 2 $self->{B} = block($toks);
1336 }
1337 2 return $self;
1338 }
1339  
1340  
1341 sub __enlist__ {
1342 2 ▶ return ($_[0]..$_[1]);
Subroutine __enlist__: called CC=1 SCAR=0.0
1343 }
1344  
1345 sub __enquote__ {
1346 0 ▶ return join " ", @_;
Subroutine __enquote__: not called CC=1 SCAR=6.9
1347 }
1348  
1349 sub __encatenate__ {
1350 1 ▶ return join "", @_;
Subroutine __encatenate__: called CC=1 SCAR=0.0
1351 }
1352  
1353 sub __lastelem__(\@) {
1354 0 ▶ return $#{$_[0]};
Subroutine __lastelem__: not called CC=1 SCAR=6.9
1355 }
1356  
1357 3 my %lb = ( '@'=>'[', '%'=>'{' );
1358 3 my %rb = ( '@'=>']', '%'=>'}' );
1359  
1360 sub STATEMENT::translate {
1361 16 ▶ my $verb = $_[0]{V}->translate;
Subroutine translate: called CC=33 SCAR=44.8
1362 16 my $prefix = $_[0]{V}{prefix};
1363 16 my $hasblock = $verb =~ m{^(grep|map)$};
1364 my $noparen = $_[0]{V}{lex} eq 'OWNER_D' && $_[0]{V}{raw} =~ /o$/
1365 16 ▶ || $_[0]{V}{raw} =~ /^(finis|nuntius|factor(em|i))$/
Condition66%6/9
$_[0]{'V'}{'lex'} eq 'OWNER_D' && $_[0]{'V'}{'raw'} =~ /o$/ || $_[0]{'V'}{'raw'} =~ /^(finis|nuntius|factor(em|i))$/ || $hasblock
l!l&&r!l&&!r
1015
$_[0]{"V"}{"lex"} eq "OWNER_D" and $_[0]{"V"}{"raw"} =~ /o$/ or $_[0]{"V"}{"raw"} =~ /^(finis|nuntius|factor(em|i))$/
l!l&&r!l&&!r
1015
$_[0]{"V"}{"lex"} eq "OWNER_D" and $_[0]{"V"}{"raw"} =~ /o$/
!ll&&!rl&&r
1501
MC/DC25%1/4
$_[0]{'V'}{'lex'} eq 'OWNER_D' && $_[0]{'V'}{'raw'} =~ /o$/ || $_[0]{'V'}{'raw'} =~ /^(finis|nuntius|factor(em|i))$/ || $hasblock
$_[0]{"V"}{"lex"} eq "OWNER_D" $_[0]{"V"}{"raw"} =~ /o$/ $_[0]{"V"}{"raw"} =~ /^(finis|nuntius|factor(em|i))$/ $hasblock
Truth table28%2/7
A and B or C || D
A= $_[0]{"V"}{"lex"} eq "OWNER_D"B= $_[0]{"V"}{"raw"} =~ /o$/C= $_[0]{"V"}{"raw"} =~ /^(finis|nuntius|factor(em|i))$/D= $hasblock
ABCDresult
11XX1
0X1X1
101X1
0X011
10011
0X000
10000
1366 || $hasblock;
1367 my $dative = defined $_[0]{D}
1368 ? $_[0]{D}->translate
1369 16 ▶ : "";
Branch: 1 branch
BranchTrueFalseTotal
defined $_[0]{'D'} ? : 9 7 16
1370 16 ▶ my $Dref = $verb =~ /^(bless)$/ && $dative =~ /^[%@]/ ? "\\" : "";
Branch: 1 branch
BranchTrueFalseTotal
$verb =~ /^(bless)$/ && $dative =~ /^[%\@]/ ? : 0 16 16
Condition33%1/3
$verb =~ /^(bless)$/ and $dative =~ /^[%\@]/
!ll&&!rl&&r
1600
MC/DC0%0/2
$verb =~ /^(bless)$/ and $dative =~ /^[%\@]/
$verb =~ /^(bless)$/ $dative =~ /^[%\@]/
Truth table33%1/3
A and B
A= $verb =~ /^(bless)$/B= $dative =~ /^[%\@]/
ABresult
0X0
100
111
1371 16 ▶ $dative = $Dref . $dative if $dative;
Branch: 1 branch
BranchTrueFalseTotal
if $dative 9 7 16
1372 16 ▶ my $Dcomma = $dative && defined $_[0]{A} && !$hasblock && $verb !~ /^(print|printf)$/ ? "," : "";
Branch: 1 branch
BranchTrueFalseTotal
$dative && defined $_[0]{'A'} && !$hasblock && !($verb =~ /^(print|printf)$/) ? : 2 14 16
Condition88%8/9
$dative and defined $_[0]{"A"} and not $hasblock and not $verb =~ /^(print|printf)$/
!ll&&!rl&&r
952
$dative and defined $_[0]{"A"} and not $hasblock
!ll&&!rl&&r
907
$dative and defined $_[0]{"A"}
!ll&&!rl&&r
727
MC/DC75%3/4
$dative and defined $_[0]{"A"} and not $hasblock and not $verb =~ /^(print|printf)$/
$dative defined $_[0]{"A"} not $hasblock not $verb =~ /^(print|printf)$/
Truth table80%4/5
A and B and not(C) and not(D)
A= $dativeB= defined $_[0]{"A"}C= not $hasblockD= not $verb =~ /^(print|printf)$/
ABCDresult
0XXX0
10XX0
110X0
11100
11111
1373 16 ▶ if ($verb =~ /^(package|use)$/) {
Branch: 8 branches
BranchTrueFalseTotal
if ($verb =~ /^(package|use)$/) { } 0 16 16
elsif ($verb eq ':') { } 0 16 16
elsif ($_[0]{'V'}{'diamond'}) { } 0 16 16
elsif ($verb =~ /^[\$%\@]\{$/) { } 0 16 16
elsif (not $_[0]{'V'}{'operator'}) { } 12 4 16
elsif ($prefix and $dative) { } 0 4 4
elsif ($prefix) { } 0 4 4
elsif ($verb eq '=') { } 2 2 4
1374 0 return "$verb $_[0]{A}[0]{raw} ";
1375 }
1376 elsif ($verb eq ':') { # LABEL
1377 0 return " $_[0]{A}[0]{raw}: ";
1378 }
1379 elsif ($_[0]{V}{diamond}) {
1380 0 $result = "<" . substr($dative,1) . ">";
1381 }
1382 elsif ($verb =~ /^[\$%@]\{$/) {
1383 0 $result = $verb . $_[0]{A}[0]->translate . '}';
1384 }
1385 elsif (! $_[0]{V}{operator}) {
1386 $result = "$verb "
1387 . ($noparen ? "" : "(")
1388 . $dative . $Dcomma
1389 . " "
1390 12 ▶ . (defined $_[0]{A} ? join ", ", map({ $_->translate($_[0]{V}) } @{$_[0]{A}}) : "")
Branch: 3 branches
BranchTrueFalseTotal
$noparen ? : 1 11 12
defined $_[0]{'A'} ? : 10 2 12
$noparen ? : 1 11 12
1391 . ($noparen ? "" : ")") ;
1392 }
1393 ▶ elsif ($prefix && $dative) {
Condition33%1/3
$prefix and $dative
!ll&&!rl&&r
400
MC/DC0%0/2
$prefix and $dative
$prefix $dative
Truth table33%1/3
A and B
A= $prefixB= $dative
ABresult
0X0
100
111
1394 0 $result = " $verb $dative ";
1395 }
1396 elsif ($prefix) {
1397 0 $result = " $verb (" . $_[0]{A}[0]->translate . ")";
1398 }
1399 elsif ( $verb eq '=' ) {
1400 $result = " "
1401 . $dative
1402 . " $verb "
1403 2 . ( @{$_[0]{A}} > 1
1404 0 ? "(" . join(",", map($_->translate, @{$_[0]{A}})) . ")"
1405 2 ▶ : $_[0]{A}[0]->translate
Branch: 1 branch
BranchTrueFalseTotal
@{$_[0]{'A'};} > 1 ? : 0 2 2
1406 );
1407 }
1408 else
1409 {
1410 2 ▶ my $Acount = @{$_[0]{A}||[]};
Branch: 1 branch
BranchTrueFalseTotal
$_[0]{"A"} or [] 0 2 2
1411 2 ▶ my $neg = $verb =~ s/^!(<=>|cmp)/$1/ ? "!" : "";
Branch: 1 branch
BranchTrueFalseTotal
$verb =~ s/^!(<=>|cmp)/$1/ ? : 0 2 2
1412 $result = " $neg("
1413 . ( $dative ? $dative
1414 2 ▶ : $Acount-- ? shift(@{$_[0]{A}})->translate
Branch: 1 branch
BranchTrueFalseTotal
$Acount ? : 2 0 2
1415 : "")
1416 . " $verb "
1417 2 ▶ . ( $Acount ? $_[0]{A}[0]->translate : "")
Branch: 2 branches
BranchTrueFalseTotal
$dative ? : 0 2 2
$Acount-- ? : 2 0 2
1418 . ")";
1419 }
1420 16 ▶ if ($_[0]->{G}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_[0]{"G"}) 0 16 16
1421 0 my $perl = pop(@{$_[0]->{G}})->{perl}; # LAST GENITIVE IS THE VARIABLE
1422 0 $perl =~ s/^([\%\@])/\$/;
1423 0 my $type = $1;
1424 0 ▶ while (my $next = pop @{$_[0]->{G}}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $next = pop @{$_[0]{"G"};}) 0 0 0
1425 0 $perl .= $lb{$type} . $next->translate . $rb{$type};
1426 }
1427 0 $result = $perl . $lb{$type} . $result . $rb{$type};
1428 }
1429 16 ▶ return '\\'x($_[0]{R}||0) . $result;
Condition50%1/2
$_[0]{'R'} || 0
l!l
016
MC/DC0%0/1
$_[0]{'R'} || 0
$_[0]{'R'}
Truth table50%1/2
A
A= $_[0]{'R'}
Aresult
11
00
1430 }
1431  
1432 sub BLOCK::translate {
1433 return "{"
1434 6 ▶ . join(";\n", map {$_->translate} @{$_[0]})
Subroutine translate: called CC=1 SCAR=0.0
1435 . "}" ;
1436 }
1437  
1438 sub CONNECTIVE::translate {
1439 0 ▶ return $_[0]{L}->translate . " $_[0]{perl} " . $_[0]{R}->translate;
Subroutine translate: not called CC=1 SCAR=6.9
1440 }
1441  
1442 sub Separator::translate {
1443 2 ▶ return $_[0]{perl};
Subroutine translate: called CC=1 SCAR=0.0
1444 }
1445  
1446 sub SUBNAME::translate {
1447 0 ▶ return $_[0]{perl};
Subroutine translate: not called CC=1 SCAR=6.9
1448 }
1449  
1450 sub SUBNAME_OA::translate {
1451 0 ▶ return $_[0]{perl};
Subroutine translate: not called CC=1 SCAR=6.9
1452 }
1453  
1454 sub SUBNAME_A::translate {
1455 0 ▶ return $_[0]{perl};
Subroutine translate: not called CC=1 SCAR=6.9
1456 }
1457  
1458 sub SUBNAME_D::translate {
1459 0 ▶ return $_[0]{perl};
Subroutine translate: not called CC=1 SCAR=6.9
1460 }
1461  
1462 sub SUBNAME_AD::translate {
1463 7 ▶ return $_[0]{perl};
Subroutine translate: called CC=1 SCAR=0.0
1464 }
1465  
1466 sub SUBNAME_AB::translate {
1467 0 ▶ return $_[0]{perl};
Subroutine translate: not called CC=1 SCAR=6.9
1468 }
1469  
1470 sub SUBNAME_ACCUSATIVE::translate {
1471 0 ▶ return $_[0]{perl};
Subroutine translate: not called CC=1 SCAR=6.9
1472 }
1473  
1474 sub SUBNAME_A_ACCUSATIVE::translate {
1475 3 ▶ return $_[0]{perl};
Subroutine translate: called CC=1 SCAR=0.0
1476 }
1477  
1478 sub SUBNAME_D_ACCUSATIVE::translate {
1479 1 ▶ return $_[0]{perl};
Subroutine translate: called CC=1 SCAR=0.0
1480 }
1481  
1482 sub SUBNAME_AD_ACCUSATIVE::translate {
1483 0 ▶ return $_[0]{perl};
Subroutine translate: not called CC=1 SCAR=6.9
1484 }
1485  
1486 sub SUBNAME_AB_ACCUSATIVE::translate {
1487 0 ▶ return $_[0]{perl};
Subroutine translate: not called CC=1 SCAR=6.9
1488 }
1489  
1490 sub SUBNAME_B_ACCUSATIVE::translate {
1491 0 ▶ return $_[0]{perl};
Subroutine translate: not called CC=1 SCAR=6.9
1492 }
1493  
1494 sub SUBNAME_DATIVE::translate {
1495 0 ▶ return $_[0]{perl};
Subroutine translate: not called CC=1 SCAR=6.9
1496 }
1497  
1498 sub SUBNAME_A_DATIVE::translate {
1499 2 ▶ return $_[0]{perl};
Subroutine translate: called CC=1 SCAR=0.0
1500 }
1501  
1502 sub SUBNAME_D_DATIVE::translate {
1503 0 ▶ return $_[0]{perl};
Subroutine translate: not called CC=1 SCAR=6.9
1504 }
1505  
1506 sub SUBNAME_AD_DATIVE::translate {
1507 0 ▶ return $_[0]{perl};
Subroutine translate: not called CC=1 SCAR=6.9
1508 }
1509  
1510 sub SUBNAME_AB_DATIVE::translate {
1511 0 ▶ return $_[0]{perl};
Subroutine translate: not called CC=1 SCAR=6.9
1512 }
1513  
1514 sub SUBNAME_B_DATIVE::translate {
1515 0 ▶ return $_[0]{perl};
Subroutine translate: not called CC=1 SCAR=6.9
1516 }
1517  
1518 sub DATIVE::translate {
1519 7 ▶ my ($self) = @_;
Subroutine translate: called CC=3 SCAR=17.8
1520 7 my $perl = $self->{perl};
1521 7 ▶ if ($self->{G}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"G"}) 0 7 7
1522 0 my $gen = pop(@{$self->{G}})->{perl}; # LAST GENITIVE IS THE VARIABLE
1523 0 $gen =~ s/^([\%\@])/\$/;
1524 0 my $type = $1;
1525 0 ▶ while (my $next = pop @{$self->{G}}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $next = pop @{$$self{"G"};}) 0 0 0
1526 0 $gen .= $lb{$type} . $next->translate . $rb{$type};
1527 }
1528 0 $perl = $gen . $lb{$type} . $perl . $rb{$type};
1529 }
1530 7 return $perl;
1531 }
1532  
1533 sub OWNER_D::translate {
1534 1 ▶ return $_[0]{perl};
Subroutine translate: called CC=1 SCAR=0.0
1535 }
1536  
1537 sub ACCUSATIVE::translate {
1538 16 ▶ my ($self) = @_;
Subroutine translate: called CC=4 SCAR=21.7
1539 16 my $perl = $self->{perl};
1540 16 ▶ if ($self->{G}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"G"}) 0 16 16
1541 0 my $gen = pop(@{$self->{G}})->{perl}; # LAST GENITIVE IS THE VARIABLE
1542 0 $gen =~ s/^([\%\@])/\$/;
1543 0 my $type = $1;
1544 0 ▶ while (my $next = pop @{$self->{G}}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $next = pop @{$$self{"G"};}) 0 0 0
1545 0 $gen .= $lb{$type} . $next->translate . $rb{$type};
1546 }
1547 0 $perl = $gen . $lb{$type} . $perl . $rb{$type};
1548 }
1549 16 ▶ return '\\'x($_[0]{R}||0) . $perl;
Condition50%1/2
$_[0]{'R'} || 0
l!l
016
MC/DC0%0/1
$_[0]{'R'} || 0
$_[0]{'R'}
Truth table50%1/2
A
A= $_[0]{'R'}
Aresult
11
00
1550 }
1551  
1552 sub CONTROL::translate {
1553 return $_[0]{perl}
1554 . " (" . $_[0]{C}->translate . ") "
1555 . $_[0]{B}->translate
1556 2 ▶ . "\n";
Subroutine translate: called CC=1 SCAR=0.0
1557 }
1558  
1559 sub FOR::translate {
1560 return $_[0]{perl}
1561 . " " . $_[0]{D}->translate
1562 . " (" . $_[0]{C}->translate . ") "
1563 . $_[0]{B}->translate
1564 2 ▶ . "\n";
Subroutine translate: called CC=1 SCAR=0.0
1565 }
1566  
1567 sub NUMERAL::translate {
1568 8 ▶ my ($self) = @_;
Subroutine translate: called CC=1 SCAR=0.0
1569 # if ($self->{G}) {
1570 # return $self->{G}->index($self->{perl});
1571 # }
1572 8 return $self->{perl};
1573 }
1574  
1575 sub ORDINAL::translate {
1576 3 ▶ my ($self) = @_;
Subroutine translate: called CC=3 SCAR=11.3
1577 3 ▶ return $self->{perl} unless $self->{G};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"G"} 0 3 3
1578 3 my $perl = pop(@{$self->{G}})->translate; # LAST GENITIVE IS THE VARIABLE
1579 3 $perl =~ s/^([\%\@])/\$/;
1580 3 my $type = $1;
1581 3 ▶ while (my $next = pop @{$self->{G}}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $next = pop @{$$self{"G"};}) 0 3 3
1582 0 $perl .= $lb{$type} . $next->translate . $rb{$type};
1583 }
1584 3 return $perl . $lb{$type} . $self->{perl} . $rb{$type};
1585 }
1586  
1587 3 *ORDINAL_DATIVE::translate = *ORDINAL::translate;
1588  
1589 sub DISJUNCTION::translate {
1590 0 ▶ return $_[0]{perl};
Subroutine translate: not called CC=1 SCAR=6.9
1591 }
1592  
1593 sub CONJUNCTION::translate {
1594 0 ▶ return $_[0]{perl};
Subroutine translate: not called CC=1 SCAR=6.9
1595 }
1596  
1597 sub Literal::translate {
1598 10 ▶ my ($self, $context) = @_;
Subroutine translate: called CC=9 SCAR=30.9
1599 10 my $perl;
1600 10 ▶ if ($context && $context->{raw} =~ /^inque/) {
Branch: 4 branches
BranchTrueFalseTotal
if ($context and $context->{'raw'} =~ /^inque/) { } 0 10 10
elsif ($self->{'lex'} eq 'GENITIVE') { } 0 10 10
elsif ($self->{'lex'} eq 'SUBNAME_A_GENITIVE') { } 0 10 10
elsif ($self->{'lex'} eq 'INFINITIVE') { } 2 8 10
Condition66%2/3
$context and $context->{"raw"} =~ /^inque/
!ll&&!rl&&r
820
MC/DC0%0/2
$context and $context->{"raw"} =~ /^inque/
$context $context->{"raw"} =~ /^inque/
Truth table66%2/3
A and B
A= $contextB= $context->{"raw"} =~ /^inque/
ABresult
0X0
100
111
1601 0 $perl = qq{'$_[0]{raw}'}
1602 }
1603 elsif ( $self->{lex} eq 'GENITIVE' ) {
1604 0 $perl = $self->GENITIVE::translate;
1605 }
1606 elsif ( $self->{lex} eq 'SUBNAME_A_GENITIVE' ) {
1607 0 $perl = $self->SUBNAME_A_GENITIVE::translate;
1608 }
1609 elsif ( $self->{lex} eq 'INFINITIVE' ) {
1610 2 $perl = "sub $_[0]{perl}\n" . $_[0]{B}->translate;
1611 }
1612 else {
1613 $perl = '\\'x($_[0]{R}||0) . $_[0]{perl}
1614 8 ▶ }
Condition50%1/2
$_[0]{'R'} || 0
l!l
08
MC/DC0%0/1
$_[0]{'R'} || 0
$_[0]{'R'}
Truth table50%1/2
A
A= $_[0]{'R'}
Aresult
11
00
1615 10 ▶ if ($self->{G}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"G"}) 0 10 10
1616 0 my $gen = pop(@{$self->{G}})->{perl}; # LAST GENITIVE IS THE VARIABLE
1617 0 $gen =~ s/^([\%\@])/\$/;
1618 0 my $type = $1;
1619 0 ▶ while (my $next = pop @{$self->{G}}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $next = pop @{$$self{"G"};}) 0 0 0
1620 0 $gen .= $lb{$type} . $next->translate . $rb{$type};
1621 }
1622 0 $perl = $gen . $lb{$type} . $perl . $rb{$type};
1623 }
1624 10 return $perl;
1625 }
1626  
1627 sub GENITIVE::translate {
1628 3 ▶ return $_[0]{perl};
Subroutine translate: called CC=1 SCAR=0.0
1629 };
1630  
1631 sub SUBNAME_A_GENITIVE::translate {
1632 0 ▶ return $_[0]{perl};
Subroutine translate: not called CC=1 SCAR=6.9
1633 };
1634  
1635 sub Name::translate {
1636 5 ▶ return qq{'$_[0]{raw}'}
Subroutine translate: called CC=1 SCAR=0.0
1637 }
1638  
1639 3 1;
1640  
1641 __END__
↑ Summary