This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
symbian/xsbuild.pl
[perl5.git] / perl_keyword.pl
index d0471f6..f71c7d0 100644 (file)
@@ -8,9 +8,9 @@ use warnings;
 my @pos = qw(__DATA__ __END__ AUTOLOAD BEGIN CHECK DESTROY default defined
            delete do END else eval elsif exists for format foreach given grep
            goto glob INIT if last local m my map next no our pos print printf
-           package prototype q qr qq qw qx redo return require s scalar sort
-           split study sub tr tie tied use undef until untie unless when while
-           y);
+           package prototype q qr qq qw qx redo return require s say scalar sort
+           split state study sub tr tie tied use undef UNITCHECK until untie
+           unless when while y);
 
 my @neg = qw(__FILE__ __LINE__ __PACKAGE__ and abs alarm atan2 accept bless
            break bind binmode CORE cmp chr cos chop close chdir chomp chmod
@@ -26,7 +26,7 @@ my @neg = qw(__FILE__ __LINE__ __PACKAGE__ and abs alarm atan2 accept bless
            length listen lcfirst localtime mkdir msgctl msgget msgrcv msgsnd
            ne not or ord oct open opendir pop push pack pipe quotemeta ref
            read rand recv rmdir reset rename rindex reverse readdir readlink
-           readline readpipe rewinddir say seek send semop select semctl semget
+           readline readpipe rewinddir seek send semop select semctl semget
            setpgrp seekdir setpwent setgrent setnetent setsockopt sethostent
            setservent setpriority setprotoent shift shmctl shmget shmread
            shmwrite shutdown sin sleep socket socketpair sprintf splice sqrt
@@ -43,6 +43,10 @@ my %feature_kw = (
        break   => 'switch',
 
        say     => 'say',
+
+       err     => 'err',
+
+       state   => 'state',
        );
 
 my %pos = map { ($_ => 1) } @pos;
@@ -63,8 +67,9 @@ print <<END;
  */
 
 I32
-Perl_keyword (pTHX_ const char *name, I32 len)
+Perl_keyword (pTHX_ const char *name, I32 len, bool all_keywords)
 {
+    dVAR;
 $switch
 unknown:
   return 0;
@@ -83,10 +88,9 @@ if(ckWARN_d(WARN_SYNTAX))
 END
   }
   elsif (my $feature = $feature_kw{$k}) {
-    my $feature_len = length($feature);
     $feature =~ s/([\\"])/\\$1/g;
     return <<END;
-return (FEATURE_IS_ENABLED("$feature", $feature_len) ? ${sign}KEY_$k : 0);
+return (all_keywords || FEATURE_IS_ENABLED("$feature") ? ${sign}KEY_$k : 0);
 END
   }
   return <<END;