FEATURE_IS_ENABLED("__SUB__")) \
)
+#define FEATURE_LEXSUBS_IS_ENABLED \
+ ( \
+ CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_CUSTOM && \
+ FEATURE_IS_ENABLED("lexsubs") \
+ )
+
#define FEATURE_UNIEVAL_IS_ENABLED \
( \
CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_515 \
evalbytes => 'feature_evalbytes',
array_base => 'feature_arybase',
current_sub => 'feature___SUB__',
+ lexical_subs => 'feature_lexsubs',
unicode_eval => 'feature_unieval',
unicode_strings => 'feature_unicode',
);
"5.10" => [qw(array_base say state switch)],
"5.11" => [qw(array_base say state switch unicode_strings)],
"5.15" => [qw(current_sub evalbytes fc say state switch unicode_eval unicode_strings)],
- "all" => [qw(array_base current_sub evalbytes fc say state switch unicode_eval unicode_strings)],
+ "all" => [qw(array_base current_sub evalbytes fc lexical_subs say state switch unicode_eval unicode_strings)],
"default" => [qw(array_base)],
);
$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"};
+my %experimental = (
+ lexical_subs => 1,
+);
our $hint_shift = 26;
our $hint_mask = 0x1c000000;
if ($import) {
$^H{$feature{$name}} = 1;
$^H |= $hint_uni8bit if $name eq 'unicode_strings';
+ if ($experimental{$name}) {
+ require warnings;
+ warnings::warnif("experimental:$name",
+ "The $name feature is experimental");
+ }
} else {
delete $^H{$feature{$name}};
$^H &= ~ $hint_uni8bit if $name eq 'unicode_strings';
will continue to pretend that it is. And if you quote me on that, I
will deny it.
+=item The %s feature is experimental
+
+(S experimental) This warning is emitted if you enable an experimental
+feature via C<use feature>. Simply suppress the warning if you want
+to use the feature, but know that in doing so you are taking the risk
+of using an experimental feature which may change or be removed in a
+future Perl version:
+
+ no warnings "experimental:lexical_subs";
+ use feature "lexical_subs";
+
=item The %s function is unimplemented
(F) The function indicated isn't implemented on this architecture, according
evalbytes => 'evalbytes',
array_base => 'arybase',
current_sub => '__SUB__',
+ lexical_subs => 'lexsubs',
unicode_eval => 'unieval',
unicode_strings => 'unicode',
fc => 'fc',
evalbytes current_sub fc)],
);
+my @experimental = qw( lexical_subs );
+
###########################################################################
# More data generated from the above
print $pm "our %feature = (\n";
my $width = length longest keys %feature;
-for(sort { length $a <=> length $b } keys %feature) {
+for(sort { length $a <=> length $b || $a cmp $b } keys %feature) {
print $pm " $_" . " "x($width-length)
. " => 'feature_$feature{$_}',\n";
}
qq'\$feature_bundle{"$_"} = \$feature_bundle{"$Aliases{$_}"};\n';
};
+print $pm "my \%experimental = (\n";
+print $pm " $_ => 1,\n", for @experimental;
+print $pm ");\n";
+
print $pm <<EOPM;
our \$hint_shift = $HintShift;
EOL
for (
- sort { length $a <=> length $b } keys %feature
+ sort { length $a <=> length $b || $a cmp $b } keys %feature
) {
my($first,$last) =
map { (my $__ = uc) =~ y/.//d; $__ } @{$BundleRanges{$_}};
EOH3
}
- else {
+ elsif ($first) {
print $h <<EOH4;
#define FEATURE_$NAME\_IS_ENABLED \\
( \\
EOH4
}
+ else {
+ print $h <<EOH5;
+#define FEATURE_$NAME\_IS_ENABLED \\
+ ( \\
+ CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_CUSTOM && \\
+ FEATURE_IS_ENABLED("$name") \\
+ )
+
+EOH5
+ }
}
print $h <<EOH;
if ($import) {
$^H{$feature{$name}} = 1;
$^H |= $hint_uni8bit if $name eq 'unicode_strings';
+ if ($experimental{$name}) {
+ require warnings;
+ warnings::warnif("experimental:$name",
+ "The $name feature is experimental");
+ }
} else {
delete $^H{$feature{$name}};
$^H &= ~ $hint_uni8bit if $name eq 'unicode_strings';