diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-12-22 16:13:17 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-12-24 09:25:14 -0800 |
commit | 40e4d872ac5e7318bdf400a3bdf5a89c482c2003 (patch) | |
tree | 2f88ca30c1dd68cf4d2d2a55e87de89b989d56b5 /regen/feature.pl | |
parent | 1ea60d37af58c675e2b5b53f80153fd8962638d4 (diff) | |
download | perl-40e4d872ac5e7318bdf400a3bdf5a89c482c2003.tar.gz |
feature.pl: %BundleRanges
This hash will be used by subsequent commits to generate macros for
checking individual features.
Diffstat (limited to 'regen/feature.pl')
-rwxr-xr-x | regen/feature.pl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/regen/feature.pl b/regen/feature.pl index 6cbcd62522..18e2ece610 100755 --- a/regen/feature.pl +++ b/regen/feature.pl @@ -31,6 +31,10 @@ my %default_feature = ( array_base => 'noarybase', ); +# NOTE: If a feature is ever enabled in a non-contiguous range of Perl +# versions, any code below that uses %BundleRanges will have to +# be changed to account. + my %feature_bundle = ( default => [keys %default_feature], "5.9.5" => [qw(say state switch array_base)], @@ -58,6 +62,21 @@ for( sort keys %feature_bundle ) { $UniqueBundles{$value} = $_; } } + # start end +my %BundleRanges; # say => ['5.10', '5.15'] # unique bundles for values +for my $bund ( + sort { $a eq 'default' ? -1 : $b eq 'default' ? 1 : $a cmp $b } + values %UniqueBundles +) { + for (@{$feature_bundle{$bund}}) { + if (@{$BundleRanges{$_} ||= []} == 2) { + $BundleRanges{$_}[1] = $bund + } + else { + push @{$BundleRanges{$_}}, $bund; + } + } +} ########################################################################### |