This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
coresubs.t: Explicitly skip all unsupported keywords
authorFather Chrysostomos <sprout@cpan.org>
Fri, 27 Apr 2012 03:36:03 +0000 (20:36 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 29 May 2012 16:36:24 +0000 (09:36 -0700)
Instead of skipping positive keywords (those that cannot be over-
ridden) because of their positivity, list them explicitly in the
skip list.

This will allow them to be removed one by one.

t/op/coresubs.t

index 85084bb..c7efa2d 100644 (file)
@@ -15,8 +15,14 @@ BEGIN {
 use B::Deparse;
 my $bd = new B::Deparse '-p';
 
-my %unsupported = map +($_=>1), qw (CORE and cmp dump eq ge gt le
-                                    lt ne or x xor);
+my %unsupported = map +($_=>1), qw (
+ __DATA__ __END__ AUTOLOAD BEGIN UNITCHECK CORE DESTROY END INIT CHECK and
+  cmp default defined delete do dump else elsif eq eval exists for foreach
+  format ge given glob goto grep gt if last le local lt m map my  ne  next
+  no or our package pos print printf prototype q qq qr qw qx redo  require
+  return s say scalar sort split state study sub tr undef unless until use
+  when while x xor y
+);
 my %args_for = (
   dbmopen  => '%1,$2,$3',
   dbmclose => '%1',
@@ -29,7 +35,7 @@ open my $kh, $keywords_file
 while(<$kh>) {
   if (m?__END__?..${\0} and /^[+-]/) {
     chomp(my $word = $');
-    if($& eq '+' || $unsupported{$word}) {
+    if($unsupported{$word}) {
       $tests ++;
       ok !defined &{"CORE::$word"}, "no CORE::$word";
     }