RB/Node/_Constants.pm

filter: Statementstmt 100% 31 / 31 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 100% 38 / 38 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« RB/Node.pm ↑ Summary
1 package Tree::RB::Node::_Constants;
2  
3 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 8 ▶use vars qw( $VERSION @EXPORT );
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 8 $VERSION = '0.500006';
8  
9 8 require Exporter;
10 8 *import = \&Exporter::import;
11  
12 8 my @Node_slots;
13 my @Node_colors;
14  
15 8 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
16 8 @Node_slots = qw(PARENT LEFT RIGHT COLOR KEY VAL);
17 8 @Node_colors = qw(RED BLACK);
18 }
19  
20 8 @EXPORT = (@Node_colors, map {"_$_"} @Node_slots);
21  
22 8 ▶use enum @Node_colors;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 8 ▶use enum @Node_slots;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 # enum doesn't allow symbols to start with "_", but we want them
26 8 foreach my $s (@Node_slots) {
27 8 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
28 48 *{"_$s"} = \&$s;
29 48 delete $Tree::RB::Node::_Constants::{$s};
30 }
31  
32 8 1; # Magic true value required at end of module
33 __END__
« RB/Node.pm ↑ Summary