Branch Coverage

blib/lib/PPIx/Regexp/Token/Interpolation.pm
Criterion Covered Total %
branch 62 90 68.8


line true false branch
64 105 0 unless defined $arg{'perl_version_introduced'}
101 0 115 unless defined($content = $self->content)
145 2 108 unless $tokenizer->interpolates
148 8 100 if (my $len = $tokenizer->find_regexp($brkt_interp_re))
153 17 83 unless defined $tokenizer->find_regexp($interp_re)
157 0 83 unless my $doc = $tokenizer->ppi_document
161 0 83 unless my $stmt = $doc->find_first("PPI::Statement")
169 0 83 unless my $next = $stmt->schild(0)
172 73 10 if ($next->isa('PPI::Token::Symbol')) { }
8 2 elsif ($next->isa('PPI::Token::Cast')) { }
2 0 elsif ($next->isa('PPI::Token::ArrayIndex')) { }
182 0 8 unless $next = $next->next_sibling
183 6 2 if ($next->isa('PPI::Token::Symbol')) { }
2 0 elsif ($next->isa('PPI::Structure::Block')) { }
187 0 6 unless defined($allow_subscript = $allow_subscript_based_on_cast_symbol{$accum[-1]->content})
197 2 0 if (@kids == 1 and $kids[0]->isa("PPI::Statement"))
199 2 0 if (@kids == 1 and $kids[0]->isa("PPI::Structure::Constructor") and $kids[0]->start eq "[")
226 43 63 unless $allow_subscript and $next = $next->snext_sibling
230 18 45 if ($next->isa("PPI::Token::Operator"))
231 14 4 unless $next->content eq "->"
233 0 4 unless $next = $next->next_sibling
236 4 0 if (my $deref = $tokenizer->__recognize_postderef("PPIx::Regexp::Token::Interpolation", $next))
244 20 25 unless $next->isa("PPI::Structure::Subscript")
247 0 25 unless $next->finish
255 2 23 unless not $in_regexp or $class->_subscript($next)
267 118 4 ref $_ ? :
294 0 21 unless my $left = $struct->start
296 0 21 unless my $handler = $allowed{$lc}
299 0 21 unless (my(@kids) = $struct->schildren) == 1
300 0 21 unless $kids[0]->isa("PPI::Statement")
303 0 21 unless @kids = $kids[0]->schildren
320 14 3 if ($kids[0]->isa("PPI::Token::Word"))
321 10 4 if @kids == 1
322 4 0 if $kids[1]->isa("PPI::Token::Operator") and $kids[1]->content eq "=>"
328 1 2 if (@kids and $kids[0]->isa("PPI::Token::Symbol"))
330 0 1 if @kids == 1
334 1 0 if @kids == 2 and $kids[1]->isa("PPI::Structure::Subscript")
351 4 0 if $kids[0]->isa("PPI::Token::Number")
352 0 0 if $kids[0]->isa("PPI::Token::Symbol")
368 1329 105 unless exists $sigil_alternate{$character}
370 86 19 if (my($accept, $want_class) = $class->_interpolation($tokenizer, $character, 1))
376 0 19 unless my $alternate = $sigil_alternate{$character}
377 0 19 $tokenizer->cookie(']') ? :
385 13 5 unless exists $sigil_alternate{$character}
387 5 0 if (my($accept, $want_class) = $class->_interpolation($tokenizer, $character, 0))