Lexer/Token.pm

filter: Statementstmt 67.7% 21 / 31 Branchbran 25.0% 1 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 80.0% 8 / 10 Podpod 100% 6 / 6 totaltotal 66.6% 36 / 54 CC 4 SCAR 13.3
CC
4
Cov
59%
inspect
12.0
yylval_svop
2.0
type_str
2.0
CRAP 3.8
↑ Summary Lexer.pm »
1 package Perl::Lexer::Token;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use 5.010000;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 0 ▶sub inspect {
Subroutine inspect: not called CC=3 SCAR=24.8
Pod documented
8 0 my $self = shift;
9 0 my $ret = '<Token: ';
10 0 $ret .= $self->name . ' ' . lc($self->type_str);
11 0 ▶ if (UNIVERSAL::isa($self->yylval, 'B::SVOP')) {
Branch: 1 branch
BranchTrueFalseTotal
if (UNIVERSAL::isa($self->yylval, 'B::SVOP')) { } 0 0 0
12 0 $ret .= ' ' . $self->yylval_svop;
13 } else {
14 0 ▶ $ret .= ' ' . ($self->yylval || '-');
Condition0%0/2
$self->yylval || '-'
l!l
00
MC/DC0%0/1
$self->yylval || '-'
$self->yylval
Truth table0%0/2
A
A= $self->yylval
Aresult
11
00
15 }
16 0 $ret .= '>';
17 0 return $ret;
18 }
19  
20 16 ▶sub name {
Subroutine name: called CC=1 SCAR=0.0
Pod documented
21 16 my $self = shift;
22 16 _name($self->[0]);
23 }
24  
25 8 ▶sub type {
Subroutine type: called CC=1 SCAR=0.0
Pod documented
26 8 my $self = shift;
27 8 _type($self->[0]);
28 }
29  
30 0 ▶sub type_str {
Subroutine type_str: not called CC=1 SCAR=6.9
Pod documented
31 0 my $type = shift->type;
32 +{
33 Perl::Lexer::TOKENTYPE_NONE() => 'NONE',
34 Perl::Lexer::TOKENTYPE_IVAL() => 'IVAL',
35 Perl::Lexer::TOKENTYPE_OPNUM() => 'OPNUM',
36 Perl::Lexer::TOKENTYPE_PVAL() => 'PVAL',
37 Perl::Lexer::TOKENTYPE_OPVAL() => 'OPVAL',
38 0 }->{$type};
39 }
40  
41 9 ▶sub yylval {
Subroutine yylval: called CC=1 SCAR=0.0
Pod documented
42 9 my $self = shift;
43 9 return $self->[1];
44 }
45  
46 4 ▶sub yylval_svop {
Subroutine yylval_svop: called CC=2 SCAR=7.1
Pod documented
47 4 my $self = shift;
48 4 ▶ Carp::croak("It's not SVOP") unless UNIVERSAL::isa($self->[1], 'B::SVOP');
Branch: 1 branch
BranchTrueFalseTotal
unless UNIVERSAL::isa($self->[1], "B::SVOP") 0 4 4
49 4 return _yylval_svop($self->[1]);
50 }
51  
52  
53 3 1;
54 __END__
↑ Summary Lexer.pm »