From 52fc5c56ccd9c6bab20246b4f80f558b71ad5d42 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sun, 20 May 2012 23:01:58 -0700 Subject: [PATCH] feature.pl: Make 5.even bundle imply 5.odd MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Since the 5.18 feature bundle should be added long before 5.18, to avoid last-minute blunders, and since it’s easy to forget to do it in advance, have feature.pl do it automatically. --- lib/feature.pm | 4 ++++ regen/feature.pl | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/feature.pm b/lib/feature.pm index bcbfb7a..37e571f 100644 --- a/lib/feature.pm +++ b/lib/feature.pm @@ -32,6 +32,7 @@ $feature_bundle{"5.13"} = $feature_bundle{"5.11"}; $feature_bundle{"5.14"} = $feature_bundle{"5.11"}; $feature_bundle{"5.16"} = $feature_bundle{"5.15"}; $feature_bundle{"5.17"} = $feature_bundle{"5.15"}; +$feature_bundle{"5.18"} = $feature_bundle{"5.15"}; $feature_bundle{"5.9.5"} = $feature_bundle{"5.10"}; our $hint_shift = 26; @@ -247,6 +248,9 @@ The following feature bundles are available: :5.16 say state switch unicode_strings unicode_eval evalbytes current_sub fc + :5.18 say state switch unicode_strings + unicode_eval evalbytes current_sub fc + The C<:default> bundle represents the feature set that is enabled before any C or C declaration. diff --git a/regen/feature.pl b/regen/feature.pl index 1c91fa2..15315c7 100755 --- a/regen/feature.pl +++ b/regen/feature.pl @@ -37,19 +37,16 @@ my %feature = ( # versions, any code below that uses %BundleRanges will have to # be changed to account. +# 5.odd implies the next 5.even, but an explicit 5.even can override it. my %feature_bundle = ( all => [ keys %feature ], default => [qw(array_base)], "5.9.5" => [qw(say state switch array_base)], "5.10" => [qw(say state switch array_base)], "5.11" => [qw(say state switch unicode_strings array_base)], - "5.12" => [qw(say state switch unicode_strings array_base)], "5.13" => [qw(say state switch unicode_strings array_base)], - "5.14" => [qw(say state switch unicode_strings array_base)], "5.15" => [qw(say state switch unicode_strings unicode_eval evalbytes current_sub fc)], - "5.16" => [qw(say state switch unicode_strings unicode_eval - evalbytes current_sub fc)], "5.17" => [qw(say state switch unicode_strings unicode_eval evalbytes current_sub fc)], ); @@ -58,6 +55,11 @@ my %feature_bundle = ( ########################################################################### # More data generated from the above +for (keys %feature_bundle) { + next unless /^5\.(\d*[13579])\z/; + $feature_bundle{"5.".($1+1)} ||= $feature_bundle{$_}; +} + my %UniqueBundles; # "say state switch" => 5.10 my %Aliases; # 5.12 => 5.11 for( sort keys %feature_bundle ) { -- 2.7.4