diff options
Diffstat (limited to 'dist')
-rw-r--r-- | dist/B-Deparse/Deparse.pm | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/dist/B-Deparse/Deparse.pm b/dist/B-Deparse/Deparse.pm index 354e30f62c..1dc1ef435b 100644 --- a/dist/B-Deparse/Deparse.pm +++ b/dist/B-Deparse/Deparse.pm @@ -1681,6 +1681,17 @@ my %feature_keywords = ( fc => 'fc', ); +# keywords that are strong and also have a prototype +# +my %strong_proto_keywords = map { $_ => 1 } qw( + glob + pos + prototype + scalar + study + undef +); + sub keyword { my $self = shift; my $name = shift; @@ -1696,9 +1707,9 @@ sub keyword { if !$hh || !$hh->{"feature_$feature_keywords{$name}"} } - if ( - $name !~ /^(?:chom?p|do|exec|glob|s(?:elect|ystem))\z/ - && !defined eval{prototype "CORE::$name"} + if ($strong_proto_keywords{$name} + || ($name !~ /^(?:chom?p|do|exec|glob|s(?:elect|ystem))\z/ + && !defined eval{prototype "CORE::$name"}) ) { return $name } if ( exists $self->{subs_declared}{$name} |