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 CC 2 SCAR 5.3
CC
2
Cov
50%
new
2.0
as_string
2.0
union
2.0
CRAP 1.7
« FLAT/Transition.pm ↑ Summary FLAT/Regex.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 2823 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod undocumented
9 2823 my ($pkg, $label) = @_;
10 2823 ▶ bless {
Branch: 1 branch
BranchTrueFalseTotal
!($label =~ /^\s*$/g) ? : 2539 284 2823
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 0 ▶sub as_string {
Subroutine as_string: not called CC=1 SCAR=6.9
Pod undocumented
18 0 my $self = shift;
19 0 return $self->{OBJECT}->as_string;
20 }
21  
22 # provided interface to merging labels
23  
24 0 ▶sub union {
Subroutine union: not called CC=1 SCAR=6.9
Pod undocumented
25 0 my $self = shift;
26 0 $self->{OBJECT} = $self->{OBJECT}->union($_[0]->{OBJECT});
27 # update label
28 0 $self->{LABEL} = $self->{OBJECT}->as_string;
29 }
30  
31 0 ▶sub concat {
Subroutine concat: not called CC=1 SCAR=6.9
Pod undocumented
32 0 my $self = shift;
33 0 $self->{OBJECT} = $self->{OBJECT}->concat($_[0]->{OBJECT});
34 # update label
35 0 $self->{LABEL} = $self->{OBJECT}->as_string;
36 }
37  
38 0 ▶sub kleene {
Subroutine kleene: not called CC=1 SCAR=6.9
Pod undocumented
39 0 my $self = shift;
40 0 $self->{OBJECT} = $self->{OBJECT}->kleene();
41 # update label
42 0 $self->{LABEL} = $self->{OBJECT}->as_string;
43 }
44  
45 0 ▶sub shuffle {
Subroutine shuffle: not called CC=1 SCAR=6.9
Pod undocumented
46 0 my $self = shift;
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.pm ↑ Summary FLAT/Regex.pm »