| 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__ | ||