FLAT/Symbol/Regex.pm

filter: Statementstmt 46.1% 12 / 26 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 44.4% 4 / 9 Podpod 0.0% 0 / 6 totaltotal 41.8% 18 / 43 SCAR 9.2
CC
2
Cov
50%
new
2.0
as_string
2.0
union
2.0
CRAP 2.5
« FLAT/Transition/Simple.pm ↑ Summary FLAT/DFA/Util.pm »
1 package FLAT::Symbol::Regex;
2  
3 6 ▶use parent 'FLAT::Symbol';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use FLAT::Regex::WithExtraOps;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 sub new {
9 2871 ▶ my ($pkg, $label) = @_;
Subroutine new: called CC=2 SCAR=6.9
Pod undocumented
10 2871 ▶ bless {
Branch: 1 branch
BranchTrueFalseTotal
!($label =~ /^\s*$/g) ? : 2587 284 2871
11 COUNT => 1,
12 OBJECT => $label !~ m/^\s*$/g ? FLAT::Regex::WithExtraOps->new($label) : FLAT::Regex::WithExtraOps->new('[epsilon]'),
13 LABEL => $label,
14 }, $pkg;
15 }
16  
17 sub as_string {
18 0 ▶ my $self = shift;
Subroutine as_string: not called CC=1 SCAR=6.9
Pod undocumented
19 0 return $self->{OBJECT}->as_string;
20 }
21  
22 # provided interface to merging labels
23  
24 sub union {
25 0 ▶ my $self = shift;
Subroutine union: not called CC=1 SCAR=6.9
Pod undocumented
26 0 $self->{OBJECT} = $self->{OBJECT}->union($_[0]->{OBJECT});
27 # update label
28 0 $self->{LABEL} = $self->{OBJECT}->as_string;
29 }
30  
31 sub concat {
32 0 ▶ my $self = shift;
Subroutine concat: not called CC=1 SCAR=6.9
Pod undocumented
33 0 $self->{OBJECT} = $self->{OBJECT}->concat($_[0]->{OBJECT});
34 # update label
35 0 $self->{LABEL} = $self->{OBJECT}->as_string;
36 }
37  
38 sub kleene {
39 0 ▶ my $self = shift;
Subroutine kleene: not called CC=1 SCAR=6.9
Pod undocumented
40 0 $self->{OBJECT} = $self->{OBJECT}->kleene();
41 # update label
42 0 $self->{LABEL} = $self->{OBJECT}->as_string;
43 }
44  
45 sub shuffle {
46 0 ▶ my $self = shift;
Subroutine shuffle: not called CC=1 SCAR=6.9
Pod undocumented
47 0 $self->{OBJECT} = $self->{OBJECT}->shuffle($_[0]->{OBJECT});
48 # update label
49 0 $self->{LABEL} = $self->{OBJECT}->as_string;
50 }
51  
52 6 1;
« FLAT/Transition/Simple.pm ↑ Summary FLAT/DFA/Util.pm »