Branch Coverage

blib/lib/JE/Parser.pm
Criterion Covered Total %
branch 394 642 61.3


line true false branch
50 0 0 unless $in_list
75 0 143 /^-/ ? :
219 32246 9838 unless /\G (?: '([^'\\]*(?:\\.[^'\\]*)*)' | "([^"\\]*(?:\\.[^"\\]*)*)" )/cgsx
244 16 18866 defined $6 ? :
28 18882 $5 ? :
126 18910 $4 ? :
2442 19036 $3 ? :
356 21478 $2 ? :
178 21834 $1 ? :
256 10650 21596 unless /\G (?: 0[Xx] ([A-Fa-f0-9]+) | 0 ([01234567]+) | (?=[0-9]|\.[0-9]) ( (?:0|[1-9][0-9]*)? (?:\.[0-9]*)? (?:[Ee][+-]?[0-9]+)? ) ) /cgx
269 15 21510 defined $2 ? :
71 21525 defined $1 ? :
286 1 23696 unless $ident =~ /^[\p{ID_Start}\$_] [\p{ID_Continue}\$_]* \z/x
297 930 5553 unless my($ident) = /\G($ident)/cgox
304 0 364 unless /\G\(/cg
306 111 253 if (@ret != push(@ret, &ident))
310 2 98 unless @ret != push(@ret, &ident)
314 2 360 unless /\G\)/cg
321 163 61605 if (/\Gfunction(?!$id_cont)$s/cg) { }
20040 41565 elsif (($tmp) = /\G($ident)/cgox) { }
31343 10222 elsif (defined($tmp = &str) or defined($tmp = &num)) { }
317 9905 elsif (m(\G / ( (?:[^/*\\[] | \\. | \[ (?>(?:[^]\\] | \\.)*) \] ) (?>(?:[^/\\[] | \\. | \[ (?>(?:[^]\\] | \\.)*) \] )*) ) / ($id_cont*) )cgox) { }
5291 4614 elsif (/\G\[$s/cg) { }
552 4062 elsif (/\G\{$s/cg) { }
812 3250 elsif (/\G\($s/cg) { }
323 7 156 if @ret == 2
326 0 163 unless /\G \{ /cgx
331 0 163 unless /\G \} /cgox
338 1769 18271 if $tmp =~ /^(?:(?:tru|fals)e|null)\z/
339 216 18055 if $tmp eq 'this'
370 20721 169 if @ret != ($length = push(@ret, &assign))
372 5291 15599 if $length == @ret
375 4 5287 unless /\G]/cg
381 28 427 if ($tmp = &ident or defined($tmp = &str) and $tmp =~ s/^s// or defined($tmp = &num))
386 0 125 unless /\G:$s/cg
387 0 125 unless @ret != push(@ret, &assign)
395 1 63 unless ($tmp = ident or defined($tmp = &str) and $tmp =~ s/^s// or defined($tmp = &num))
398 0 1 unless /\G}/cg
407 0 100 unless /\G:$s/cg
408 0 100 unless @ret != push(@ret, &assign)
413 0 551 unless /\G}/cg
417 0 812 unless my $ret = &expr
419 0 812 unless /\G\)/cg
428 1012 70588 if (/\G$s\[$s/cg) { }
4220 66368 elsif (/\G$s\.$s/cg) { }
429 0 1012 unless $subscript = &expr
431 0 1012 unless /\G]/cog
434 0 4220 unless $subscript = &ident
444 61154 10414 unless /\G$s\($s/cg
445 9030 1384 if (@ret != push(@ret, &assign))
449 0 9255 unless @ret != push(@ret, &assign)
454 2 10412 unless /\G\)/cg
459 61768 1007 unless /\G new(?!$id_cont) $s /cgx
468 975 32 @member_expr == 1 ? :
477 3250 58508 unless @ret != push(@ret, &new_expr || &term)
480 47387 11119 @ret == 1 ? :
58506 0 @ret ? :
488 3250 58506 unless @ret != push(@ret, &left_expr)
490 58412 94 @ret == 1 ? :
501 1 3249 @ret ? :
3250 58506 unless @ret != push(@ret, &postfix)
506 49877 8629 @ret == 1 ? :
512 3249 58287 unless @ret != push(@ret, &unary)
515 0 219 if @ret == push(@ret, &unary)
517 58078 209 @ret == 1 ? :
523 3249 57009 unless @ret != push(@ret, &multi)
526 0 1278 if @ret == push(@ret, &multi)
528 56107 902 @ret == 1 ? :
534 3249 56853 if @ret == push(@ret, &add)
537 0 156 if @ret == push(@ret, &add)
539 56697 156 @ret == 1 ? :
545 3236 55332 if @ret == push(@ret, &bitshift)
549 0 957 if @ret == push(@ret, &bitshift)
551 54375 957 @ret == 1 ? :
557 13 552 if @ret == push(@ret, &bitshift)
561 0 12 if @ret == push(@ret, &bitshift)
563 540 12 @ret == 1 ? :
569 3236 52565 if @ret == push(@ret, &rel)
572 0 2767 if @ret == push(@ret, &rel)
574 49900 2665 @ret == 1 ? :
580 13 542 if @ret == push(@ret, &rel_noin)
583 0 10 if @ret == push(@ret, &rel_noin)
585 532 10 @ret == 1 ? :
591 3236 52513 if @ret == push(@ret, &equal)
593 0 52 if @ret == push(@ret, '&', &equal)
595 52461 52 @ret == 1 ? :
601 13 540 if @ret == push(@ret, &equal_noin)
603 0 2 if @ret == push(@ret, '&', &equal_noin)
606 538 2 @ret == 1 ? :
612 3236 52460 if @ret == push(@ret, &bit_and)
614 0 53 if @ret == push(@ret, '|', &bit_and)
616 52407 53 @ret == 1 ? :
622 13 538 if @ret == push(@ret, &bit_and_noin)
624 0 2 if @ret == push(@ret, '|', &bit_and_noin)
627 536 2 @ret == 1 ? :
633 3236 52408 if @ret == push(@ret, &bit_or)
635 0 52 if @ret == push(@ret, '^', &bit_or)
637 52356 52 @ret == 1 ? :
643 13 536 if @ret == push(@ret, &bit_or_noin)
645 0 2 if @ret == push(@ret, '^', &bit_or_noin)
648 534 2 @ret == 1 ? :
655 3236 51931 if @ret == push(@ret, &bit_xor)
657 0 477 if @ret == push(@ret, '&&', &bit_xor)
660 51659 272 @ret == 1 ? :
666 13 534 if @ret == push(@ret, &bit_xor_noin)
668 0 2 if @ret == push(@ret, '&&', &bit_xor_noin)
671 532 2 @ret == 1 ? :
677 3236 51851 if @ret == push(@ret, &and_expr)
679 0 80 if @ret == push(@ret, '||', &and_expr)
682 51773 78 @ret == 1 ? :
688 13 532 if @ret == push(@ret, &and_noin)
690 0 2 if @ret == push(@ret, '||', &and_noin)
693 530 2 @ret == 1 ? :
699 3236 50234 if @ret == push(@ret, &or_expr)
702 0 1617 if @ret == push(@ret, &or_expr)
704 48 50185 if (/\G$s\?$s/cg)
705 0 48 if @ret == push(@ret, &assign)
707 0 48 unless /\G:$s/cg
708 0 48 if @ret == push(@ret, &assign)
710 48590 1643 @ret == 1 ? :
716 13 308 if @ret == push(@ret, &or_noin)
719 0 224 if @ret == push(@ret, &or_noin)
721 6 302 if (/\G$s\?$s/cg)
722 0 6 if @ret == push(@ret, &assign)
724 0 6 unless /\G:$s/cg
725 0 6 if @ret == push(@ret, &assign_noin)
727 82 226 @ret == 1 ? :
733 1683 10292 if @$ret == push(@$ret, &assign)
735 0 304 if @$ret == push(@$ret, &assign)
743 13 224 if @$ret == push(@$ret, &assign_noin)
745 0 22 if @$ret == push(@$ret, &assign_noin)
756 0 385 if @ret == push(@ret, &ident)
757 304 81 if /\G$s=$s/cg
765 0 118 if @ret == push(@ret, &ident)
766 56 62 if /\G$s=$s/cg
776 260 41 if (@ret != push(@ret, expr)) { }
783 0 301 unless /\G;$s/cg
784 194 107 if (@ret != push(@ret, expr)) { }
791 0 301 unless /\G\)$s/cg
819 4 5 unless /$optional_sc/cg
823 16 0 unless /\G\{/cg
828 0 0 if @$ret == push(@$ret, &statement)
830 0 0 unless /\G\}$s/cg
839 16 0 unless /\G;$s/cg
845 6938 132 unless /\Gfunction$S/cg
847 0 132 if @$ret == push(@$ret, &ident)
852 0 132 unless /\G \{ /cgx
857 0 132 unless /\G \}$s /cgx
868 16 0 unless /\Gif$s\($s/cg
871 0 0 if @$ret == push(@$ret, &expr)
874 0 0 unless /\G\)$s/cg
875 0 0 unless @$ret != push(@$ret, &statement)
877 0 0 if (/\Gelse(?!$id_cont)$s/cg)
878 0 0 if @$ret == push(@$ret, &statement)
889 0 0 unless /\Gwhile$s\($s/cg
892 0 0 if @$ret == push(@$ret, &expr)
895 0 0 unless /\G\)$s/cg
896 0 0 unless @$ret != push(@$ret, &statement)
906 0 0 unless /\Gfor$s\($s/cg
909 0 0 if (/\G var$S/cgx) { }
0 0 elsif (@$ret != push(@$ret, &expr_noin)) { }
916 0 0 if (/\G([;,])$s/cg) { }
919 0 0 if ($1 eq ',')
923 0 0 if @$var == push(@$var, &vardecl)
929 0 0 unless /\G;$s/cg
935 0 0 unless /\Gin$s/cg
938 0 0 if @$ret == push(@$ret, &expr)
941 0 0 unless /\G\)$s/cg
946 0 0 if (/\G;$s/cg) { }
952 0 0 unless /\Gin$s/cg
955 0 0 if @$ret == push(@$ret, &expr)
958 0 0 unless /\G\)$s/cg
963 0 0 unless /\G;$s/cg
969 0 0 unless @$ret != push(@$ret, &statement)
979 16 0 unless /\Gwith$s\($s/cg
982 0 0 if @$ret == push(@$ret, &expr)
985 0 0 unless /\G\)$s/cg
986 0 0 unless @$ret != push(@$ret, &statement)
996 16 0 unless /\Gswitch$s\($s/cg
999 0 0 if @$ret == push(@$ret, &expr)
1002 0 0 unless /\G\)$s/cg
1003 0 0 unless /\G\{$s/cg
1006 0 0 if @$ret == push(@$ret, &expr)
1009 0 0 unless /\G:$s/cg
1013 0 0 if (/\G default(?!$id_cont) $s/cgx)
1014 0 0 unless /\G : $s /cgx
1019 0 0 if @$ret == push(@$ret, &expr)
1022 0 0 unless /\G:$s/cg
1025 0 0 $default ? :
0 0 unless /\G \} $s /cgx
1038 16 0 unless /\Gtry$s\{$s/cg
1041 0 0 unless /\G \} $s /cgx
1045 0 0 if (/\Gcatch$s/cg)
1046 0 0 unless /\G \( $s /cgx
1047 0 0 if @$ret == push(@$ret, &ident)
1050 0 0 unless /\G \) $s /cgx
1052 0 0 unless /\G \{ $s /cgx
1054 0 0 unless /\G \} $s /cgx
1056 0 0 if (/\Gfinally$s/cg)
1057 0 0 unless /\G \{ $s /cgx
1059 0 0 unless /\G \} $s /cgx
1062 0 0 if pos $_ eq $pos
1071 16 0 unless /\G ($ident) $s : $s/cgx
1077 0 0 unless @$ret != push(@$ret, &statement)
1087 16 0 unless /\G var $S/cgx
1103 0 0 unless /\G do(?!$id_cont)$s/cgx
1106 0 0 unless @$ret != push(@$ret, &statement)
1108 0 0 unless /\Gwhile$s/cg
1109 0 0 unless /\G\($s/cg
1110 0 0 unless @$ret != push(@$ret, &expr)
1113 0 0 unless /\G\)/cog
1124 16 0 unless /\G continue(?!$id_cont)/cgox
1127 0 0 if /\G$h($ident)/cog
1139 16 0 unless /\G break(?!$id_cont)/cgox
1142 0 0 if /\G$h($ident)/cog
1154 16 0 unless /\G return(?!$id_cont)/cgox
1159 0 0 if @$ret == push(@$ret, &expr)
1172 16 0 unless /\G throw(?!$id_cont)/cgox
1177 0 0 if @$ret == push(@$ret, &expr)
1187 5 9 unless my $ret = &expr
1202 1222 9733 if (/\G (?: ( \{ | ; ) | (function)$S | ( if | w(?:hile|ith) | for | switch ) $s \( $s | ( try $s \{ $s ) | ($ident) $s : $s ) /cgx) { }
1214 166 1056 if ($1 eq '{') { }
156 900 elsif ($1 eq ';') { }
34 866 elsif ($2) { }
84 782 elsif ($3 eq 'if') { }
22 760 elsif ($3 eq 'while') { }
355 405 elsif ($3 eq 'for') { }
18 387 elsif ($3 eq 'with') { }
33 354 elsif ($3 eq 'switch') { }
316 38 elsif ($4) { }
1219 165 343 if @$ret == push(@$ret, &statement_default)
1223 0 165 unless /\G\}$s/cg
1231 0 34 if @$ret == push(@$ret, &ident)
1236 0 34 unless /\G \{ /cgx
1241 0 34 unless /\G \}$s /cgx
1246 0 84 if @$ret == push(@$ret, &expr)
1249 0 84 unless /\G\)$s/cg
1250 0 84 unless @$ret != push(@$ret, &statement_default)
1252 29 55 if (/\Gelse(?!$id_cont)$s/cg)
1253 0 29 if @$ret == push(@$ret, &statement_default)
1260 0 22 if @$ret == push(@$ret, &expr)
1263 0 22 unless /\G\)$s/cg
1264 0 22 unless @$ret != push(@$ret, &statement_default)
1269 118 237 if (/\G var$S/cgx) { }
224 13 elsif (@$ret != push(@$ret, &expr_noin)) { }
1276 85 33 if (/\G([;,])$s/cg) { }
1279 34 51 if ($1 eq ',')
1283 0 34 if @$var == push(@$var, &vardecl)
1289 0 34 unless /\G;$s/cg
1295 0 33 unless /\Gin$s/cg
1298 0 33 if @$ret == push(@$ret, &expr)
1301 0 33 unless /\G\)$s/cg
1306 203 21 if (/\G;$s/cg) { }
1312 0 21 unless /\Gin$s/cg
1315 0 21 if @$ret == push(@$ret, &expr)
1318 0 21 unless /\G\)$s/cg
1323 0 13 unless /\G;$s/cg
1329 0 355 unless @$ret != push(@$ret, &statement_default)
1334 0 18 if @$ret == push(@$ret, &expr)
1337 0 18 unless /\G\)$s/cg
1338 0 18 unless @$ret != push(@$ret, &statement_default)
1343 0 33 if @$ret == push(@$ret, &expr)
1346 0 33 unless /\G\)$s/cg
1347 0 33 unless /\G\{$s/cg
1350 0 31 if @$ret == push(@$ret, &expr)
1353 0 31 unless /\G:$s/cg
1357 20 13 if (/\G default(?!$id_cont) $s/cgx)
1358 0 20 unless /\G : $s /cgx
1363 0 19 if @$ret == push(@$ret, &expr)
1366 0 19 unless /\G:$s/cg
1369 0 0 $default ? :
0 33 unless /\G \} $s /cgx
1377 0 316 unless /\G \} $s /cgx
1381 314 2 if (/\Gcatch$s/cg)
1382 0 314 unless /\G \( $s /cgx
1383 0 314 if @$ret == push(@$ret, &ident)
1386 0 314 unless /\G \) $s /cgx
1388 0 314 unless /\G \{ $s /cgx
1390 0 314 unless /\G \} $s /cgx
1392 7 309 if (/\Gfinally$s/cg)
1393 0 7 unless /\G \{ $s /cgx
1395 0 7 unless /\G \} $s /cgx
1398 0 316 if pos $_ eq $pos
1405 0 38 unless @$ret != push(@$ret, &statement_default)
1411 339 9394 if (/\G var$S/cgx) { }
25 9369 elsif (/\Gdo(?!$id_cont)$s/cg) { }
109 9260 elsif (/\G(continue|break)(?!$id_cont)/cog) { }
135 9125 elsif (/\Greturn(?!$id_cont)/cog) { }
23 9102 elsif (/\Gthrow(?!$id_cont)/cog) { }
1420 0 25 unless @$ret != push(@$ret, &statement_default)
1422 0 25 unless /\Gwhile$s/cg
1423 0 25 unless /\G\($s/cg
1424 0 25 unless @$ret != push(@$ret, &expr)
1427 0 25 unless /\G\)/cog
1431 30 79 if /\G$h($ident)/cog
1438 3 132 if @$ret == push(@$ret, &expr)
1445 1 22 if @$ret == push(@$ret, &expr)
1449 1526 7565 unless $ret = &expr
1453 3 8192 unless /$optional_sc/cgx
1456 1851 7562 unless @{$$ret[0];} == 2
1459 1851 7562 if ref $ret eq 'ARRAY'
1467 5 197 if defined($ret = &$sub)
1470 5 5 defined $ret ? :
1479 0 2937 $_parser ? :
1036 1901 unless @$ret != push(@$ret, $_parser ? &statement : &statement_default)
1491 11 340 if ($_parser) { }
1495 0 0 if @$ret != push(@$ret, &$sub)
1499 5 5 unless @$ret != push(@$ret, &statement)
1505 6938 132 if @$ret == push(@$ret, &function)
1507 325 6598 unless @$ret != push(@$ret, &statement_default)
1532 119 267 defined blessed($src) && $src->isa('JE::String') ? :
1541 12 374 if $my_global->html_mode
1597 0 351 if ($rule eq 'program' and not $_parser and ($ENV{'YES_I_WANT_JE_TO_OPTIMISE'} || '') eq 2)
1604 2 359 unless not defined pos $_ or pos $_ == length $_
1606 27 359 if (ref $@ ne '') { }
0 359 elsif ($@) { }
1607 5 0 $@->isa('JE::Object::Error') ? :
5 22 if defined blessed($@)
1610 0 22 unless ref($@) =~ /^(?:SCALAR|REF)\z/
1616 1 21 ref ${$@;} eq 'SCALAR' ? :
1635 333 31 wantarray ? :