Branch Coverage

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


line true false branch
63 105 0 unless defined $arg{'perl_version_introduced'}
100 0 115 unless defined($content = $self->content)
144 2 108 unless $tokenizer->interpolates
147 8 100 if (my $len = $tokenizer->find_regexp($brkt_interp_re))
152 17 83 unless defined $tokenizer->find_regexp($interp_re)
156 0 83 unless my $doc = $tokenizer->ppi_document
160 0 83 unless my $stmt = $doc->find_first("PPI::Statement")
168 0 83 unless my $next = $stmt->schild(0)
171 73 10 if ($next->isa('PPI::Token::Symbol')) { }
8 2 elsif ($next->isa('PPI::Token::Cast')) { }
2 0 elsif ($next->isa('PPI::Token::ArrayIndex')) { }
181 0 8 unless $next = $next->next_sibling
182 6 2 if ($next->isa('PPI::Token::Symbol')) { }
2 0 elsif ($next->isa('PPI::Structure::Block')) { }
186 0 6 unless defined($allow_subscript = $allow_subscript_based_on_cast_symbol{$accum[-1]->content})
196 2 0 if (@kids == 1 and $kids[0]->isa("PPI::Statement"))
198 2 0 if (@kids == 1 and $kids[0]->isa("PPI::Structure::Constructor") and $kids[0]->start eq "[")
225 43 63 unless $allow_subscript and $next = $next->snext_sibling
229 18 45 if ($next->isa("PPI::Token::Operator"))
230 14 4 unless $next->content eq "->"
232 0 4 unless $next = $next->next_sibling
235 4 0 if (my $deref = $tokenizer->__recognize_postderef(__PACKAGE__, $next))
243 20 25 unless $next->isa("PPI::Structure::Subscript")
246 0 25 unless $next->finish
254 2 23 unless not $in_regexp or $class->_subscript($next)
266 118 4 ref $_ ? :
293 0 21 unless my $left = $struct->start
295 0 21 unless my $handler = $allowed{$lc}
298 0 21 unless (my(@kids) = $struct->schildren) == 1
299 0 21 unless $kids[0]->isa("PPI::Statement")
302 0 21 unless @kids = $kids[0]->schildren
319 14 3 if ($kids[0]->isa("PPI::Token::Word"))
320 10 4 if @kids == 1
321 4 0 if $kids[1]->isa("PPI::Token::Operator") and $kids[1]->content eq "=>"
327 1 2 if (@kids and $kids[0]->isa("PPI::Token::Symbol"))
329 0 1 if @kids == 1
333 1 0 if @kids == 2 and $kids[1]->isa("PPI::Structure::Subscript")
350 4 0 if $kids[0]->isa("PPI::Token::Number")
351 0 0 if $kids[0]->isa("PPI::Token::Symbol")
367 1329 105 unless exists $sigil_alternate{$character}
369 86 19 if (my($accept, $want_class) = $class->_interpolation($tokenizer, $character, 1))
375 0 19 unless my $alternate = $sigil_alternate{$character}
376 0 19 $tokenizer->cookie(']') ? :
384 13 5 unless exists $sigil_alternate{$character}
386 5 0 if (my($accept, $want_class) = $class->_interpolation($tokenizer, $character, 0))