Branch Coverage

blib/lib/PPI/Tokenizer.pm
Criterion Covered Total %
branch 111 140 79.2


line true false branch
183 0 16798 if (not defined $_[1]) { }
496 16302 elsif (not ref $_[1]) { }
16302 0 elsif (&_SCALAR0($_[1])) { }
0 0 elsif (&_ARRAY0($_[1])) { }
189 496 0 if (ref $source) { }
210 16794 4 if ($self->{'source_bytes'}) { }
237 10 16788 if (&List::Util::any(sub { /^__(?:DATA|END)__\s*$/; } , @{$$self{'source'};})) { }
4 16784 elsif (not defined $self->{'source'}[0]) { }
1060 15724 elsif ($self->{'source'}[-1] =~ /\s$/) { }
285 0 380898 if ($self->{'token_eof'} and $self->{'token_cursor'} > scalar @{$self->{'tokens'};})
292 304418 76480 if (my $token = $self->{'tokens'}[$self->{'token_cursor'}])
306 46407 20791 if (defined(my $token = $self->{'tokens'}[$self->{'token_cursor'}]))
313 1 76479 if ($@) { }
46407 30072 elsif ($rv) { }
314 1 0 if (&_INSTANCE($@, 'PPI::Exception')) { }
325 30072 0 if (defined $line_rv)
327 0 30072 if (my $token = $self->{'tokens'}[$self->{'token_cursor'}])
365 4 0 unless ($self->{'token_eof'})
368 0 4 unless (defined $rv)
377 0 4 unless ($ok)
406 0 0 if $_[0]->get_token
432 0 0 unless $self->{'token_cursor'}
450 15874 89162 unless $self->{'source'}
456 16712 72450 unless defined $line
471 32113 70616 unless (defined $line)
473 30076 2037 unless ($inscan)
517 30076 67209 unless ($rv = $self->_fill_line)
518 0 30076 unless defined $rv
527 27815 39394 unless ($rv)
529 307 27508 if (ref $self->{'source'} eq "ARRAY" and not @{$self->{'source'};})
534 27815 0 if defined $rv
540 0 39393 unless (defined $rv)
548 16486 22907 unless (ref $self->{'source'} eq "ARRAY" and @{$self->{'source'};})
571 0 434430 unless (defined $self->{'line_cursor'} and defined $self->{'line_length'})
577 39393 395037 if ++$self->{'line_cursor'} >= $self->{'line_length'}
581 76272 318764 unless ($result = $self->{'class'}->__TOKENIZER__on_char($self))
583 76272 0 defined $result ? :
588 57739 261025 if ($result eq 1)
593 57739 0 if (defined $self->{'token'}) { }
596 0 0 unless defined($self->{'token'} = $self->{'class'}->new($char))
603 101525 159500 if ($self->{'class'} ne "PPI::Token::$result") { }
29517 129983 elsif (defined $self->{'token'}) { }
611 0 129983 unless defined($self->{'token'} = $self->{'class'}->new($char))
628 30078 364052 unless defined $self->{'token'}
643 9446 224621 substr($_[0], 0, 12) eq 'PPI::Token::' ? :
647 98720 135347 if defined $self->{'token'}
650 0 234067 unless defined($self->{'token'} = $class->new($_[0]))
662 82 16715 if $self->{'token'}
668 0 16797 unless (length $last_token->{'content'})
674 15451 1346 if ($self->{'source_eof_chop'})
677 13199 2252 unless (length $last_token->{'content'})
707 2712 1406 if $token->significant
723 84446 155630 unless $token->significant
725 111991 43639 if @tokens >= $count
764 119 6883 unless $p0
768 4620 2263 if defined $OBVIOUS_CLASS{$c0}
769 550 1713 if defined $OBVIOUS_CONTENT{$p0}
772 227 1486 if $p0->isa("PPI::Token::Operator")
775 0 1486 if $p0->content eq ""
785 202 942 unless @{$self->{'tokens'};}
788 0 942 unless $prev
790 160 782 if $prev->isa("PPI::Token::Word")
809 8914 23756 if (not $prev) { }
817 126 23630 if $content eq "->"
823 227 23403 if $content eq "{" and $t->{'line'} =~ /\G\s*\}/cg
832 5631 17772 if ($USUALLY_FORCES{$content})
833 10 18 if defined $word and $word =~ /^v[0-9]+$/ and $content eq 'use' || $content eq 'no'
834 5385 236 unless $prevprev
835 230 6 if not $USUALLY_FORCES{$prevprev->content} and $prevprev->content ne "->"
844 790 25896 if $t->{'line'} =~ /\G\s*=>/cg