Branch Coverage

blib/lib/Text/Highlight.pm
Criterion Covered Total %
branch 61 198 30.8


line true false branch
88 1 0 if @_ % 2 == 0
90 0 1 unless %param
93 0 1 if (exists $param{'vb'} and $param{'vb'})
103 0 1 if (exists $param{'tgml'} and $param{'tgml'})
113 0 1 if (exists $param{'ansi'} and $param{'ansi'})
133 0 0 if ($@) { }
145 0 0 unless exists $param{'escape'}
150 0 1 if (exists $param{'wordfile'})
152 0 0 if (ref $param{'wordfile'} eq 'ARRAY') { }
157 0 0 if -r $_
159 0 0 if @$tmpref > 0
161 0 0 if -r $param{'wordfile'}
166 0 1 if (exists $param{'format'})
168 0 0 if ($param{'format'} =~ /(\%s.*){2}/) { }
177 1 0 if (exists $param{'wrapper'})
180 0 1 if (not defined $param{'wrapper'}) { }
1 0 elsif ($param{'wrapper'} =~ /\%s/) { }
199 0 1 if (exists $param{'escape'})
202 0 0 if (not defined $param{'escape'}) { }
0 0 elsif (ref $param{'escape'} eq 'CODE') { }
0 0 elsif ($param{'escape'} =~ /^default$/i) { }
225 0 1 if (exists $param{'colors'})
227 0 0 if (ref $param{'colors'} eq 'HASH') { }
232 0 0 if exists $param{'colors'}{$_}
245 6 1 if @_ % 2 == 0
247 0 7 if (exists $args{'type'} and exists $args{'code'}) { }
261 0 7 unless defined wantarray
264 0 7 unless ref $self
267 0 7 if (exists $$self{'_grammars'}{$type}) { }
277 0 7 unless eval "require $grammar"
283 0 7 if ($grammar->can('highlight') and $options ne 'simple') { }
7 0 elsif ($grammar->can('syntax')) { }
321 6 0 if (defined $$self{'_active'}{'blockCommentOn'}[$_] and $$self{'_active'}{'blockCommentOn'}[$_] ne '' and defined $$self{'_active'}{'blockCommentOff'}[$_] and $$self{'_active'}{'blockCommentOff'}[$_] ne '')
343 7 17 unless defined $min
361 0 17 if ($delim eq $$self{'_active'}{'escape'})
379 7 10 if (grep {$delim eq $_;} @{$$self{'_active'}{'quot'};})
390 5 2 unless $$self{'_active'}{'continueQuote'}
405 0 8 if (not defined $m or $m eq "\n")
415 1 7 if ($m eq $$self{'_active'}{'escape'})
422 7 1 if ($m eq $delim)
430 7 0 if ($idx != -1) { }
445 4 6 if (grep {$delim eq $_;} @{$$self{'_active'}{'lineComment'};})
448 4 0 if ((my $end = index($code, "\n", $delims{$min})) != -1) { }
451 0 4 if substr($code, $end - 1, 1) eq "\r"
470 6 0 if $delim eq $$self{'_active'}{'blockCommentOn'}[$_]
6 0 if (grep {defined($t = $_) if $delim eq $$self{'_active'}{'blockCommentOn'}[$_];} 0 .. $#{$$self{'_active'}{'blockCommentOn'};})
474 6 0 if ((my $end = index($code, $$self{'_active'}{'blockCommentOff'}[$t], $delims{$min})) != -1) { }
492 7 0 if $cur != -1
519 43 40 if $$delims{$_} < $cur
522 39 44 if ($$delims{$_} == -1)
529 35 9 if not defined $min or $$delims{$_} < $$delims{$min}
554 68 163 defined $type ? :
578 107 0 defined $2 ? :
590 105 114 $$self{'_active'}{'case'} ? :
593 50 169 if (exists $$self{'_active'}{"key$key"}{$check})
606 1 106 if ($chunk =~ /^\d*\.?\d+$/)
613 56 51 unless $done
616 107 0 if defined $delim
624 0 0 if @_ % 2 == 0
626 0 0 if (exists $args{'type'} and exists $args{'grammar'}) { }
641 0 0 unless ($type)
647 0 0 if not $force and exists $$self{'_grammars'}{$type}
649 0 0 unless ($grammar)
655 0 0 if (ref $grammar eq 'HASH')
672 0 0 unless open FH, $grammar
674 0 0 if ($format eq 'editplus') { }
0 0 elsif ($format eq 'ultraedit') { }
704 0 0 if /^;/ or not /./
707 0 0 if /^\#TITLE=(.+?)$/i
708 0 0 if /^\#DELIMITER=(.+?)$/i
709 0 0 if /^\#ESCAPE=(.+?)$/i
710 0 0 if /^\#CASE=n$/i
711 0 0 if /^\#CASE=y$/i
712 0 0 if /^\#CONTINUE_QUOTE=n$/i
713 0 0 if /^\#CONTINUE_QUOTE=y$/i
715 0 0 if /^\#COMMENTON=(.+?)$/i
716 0 0 if /^\#COMMENTOFF=(.+?)$/i
717 0 0 if /^\#COMMENTON2=(.+?)$/i
718 0 0 if /^\#COMMENTOFF2=(.+?)$/i
720 0 0 if /^\#LINECOMMENT\d?=(.+?)$/i
721 0 0 if /^\#QUOTATION\d?=(.+?)$/i
723 0 0 if (/^\#KEYWORD/ and $key <= $KEYMAX)
728 0 0 if /^;/ or not /./
735 0 0 if ($$syntax{'case'}) { }
742 0 0 unless eof
757 0 0 if m[^/L\d+"(.+?)"]i
758 0 0 if /Escape Char = (\S+)/
759 0 0 if /Nocase/
760 0 0 if /String Chars = (\S{1,2})/
762 0 0 if /Block Comment On = (\S{1,5})/
763 0 0 if /Block Comment Off = (\S{1,5})/
764 0 0 if /Block Comment On Alt = (\S{1,5})/
765 0 0 if /Block Comment Off Alt = (\S{1,5})/
767 0 0 if /Line Comment (?:Alt )?= (\S{1,5})/
768 0 0 if m[^/Delimiters = (.+)$]i
771 0 0 if ($key and $key <= $KEYMAX)
785 0 0 if ($$syntax{'case'}) { }
792 0 0 unless eof
797 0 0 unless @{$$syntax{'quot'};}