Branch Coverage

blib/lib/Math/Calc/Parser.pm
Criterion Covered Total %
branch 108 120 90.0


line true false branch
22 8 0 if (eval { do { require Math::Random::Secure; 1 } })
70 0 153 &Scalar::Util::blessed($_[0]) && $_[0]->isa('Math::Complex') ? :
71 1 13 &Scalar::Util::blessed($_[0]) && $_[0]->isa('Math::Complex') ? :
74 2 2 $_[0] >= 0 ? :
78 1 24 if $r < 0
79 1 23 if $r == 9**9**9
80 1 22 if $r != $r
129 436 129 &Scalar::Util::blessed($_[0]) ? :
136 0 18 @_ == 1 ? :
138 1 17 if exists $params{'bignum'}
139 1 17 if exists $params{'bigrat'}
147 428 1 unless @_
149 1 0 if ($self->{'bignum'})
163 428 1 unless @_
165 1 0 if ($self->{'bigrat'})
184 1 9 unless $name =~ /\A[a-z]\w*\z/i
186 3 6 if ref $definition eq 'CODE'
188 1 8 unless defined(my $args = $definition->{'args'})
189 1 7 unless $args =~ /\A\d+\z/ and $args >= 0
192 1 6 unless defined(my $code = $definition->{'code'})
193 1 5 unless ref $code eq 'CODE'
195 0 5 if defined $definition->{'bignum_code'}
196 0 5 if defined $definition->{'bigrat_code'}
205 0 3 unless defined $name
206 1 2 if defined _operator($name)
231 0 851 if defined $octal and length $octal
234 11 245 if ($binop_possible and $token ne ')' and $token ne ',' and not defined _operator($token))
239 262 589 if (defined _operator($token)) { }
30 559 elsif ($token eq '(') { }
30 529 elsif ($token eq ')') { }
7 522 elsif ($token eq ',') { }
417 105 elsif (&Scalar::Util::looks_like_number($token)) { }
104 1 elsif ($token =~ /\A\w+\z/) { }
241 23 0 if (not $binop_possible and $token eq '-' || $token eq '+')
245 26 236 $token eq '!' ? :
250 1 29 unless _shunt_right_paren(\@expr_queue, \@oper_stack)
254 1 6 unless _shunt_comma(\@expr_queue, \@oper_stack)
258 80 337 if $bignum or $bigrat
262 4 100 unless exists $self->_functions->{$token}
263 70 30 if ($self->_functions->{$token}{'args'} > 0) { }
277 1 241 if $oper_stack[-1] eq '('
295 58 39 if ($oper_stat->{'lower_than'}{$top_oper} or $assoc eq 'left' and $oper_stat->{'equal_to'}{$top_oper}) { }
329 1 29 unless @$oper_stack and $oper_stack->[-1] eq '('
331 18 3 if (@$oper_stack and $oper_stack->[-1] ne '(' and not defined _operator($oper_stack->[-1]))
344 1 6 unless @$oper_stack and $oper_stack->[-1] eq '('
351 195 11 unless ref $expr eq 'ARRAY'
353 1 202 unless @$expr
359 0 728 unless defined $token
360 342 386 if (exists $self->_functions->{$token}) { }
385 1 elsif (&Scalar::Util::looks_like_number($token)) { }
363 2 340 if @eval_stack < $num_args
364 314 26 $num_args > 0 ? :
366 34 306 if $bignum || $bigrat and defined $function->{'bignum_code'}
367 2 338 if $bigrat and defined $function->{'bigrat_code'}
371 4 336 unless (eval { do { $result = &$code(@args); 1 } })
376 4 336 if ($errored)
377 0 4 unless defined $error
382 1 335 unless defined $result
394 1 193 if @eval_stack > 1
406 6 3 unless (eval { do { $result = $self->evaluate($expr); 1 } })