X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/137443ea0a858c43f5a720730cac6209a7d41948..b4222fa9a30f89a491b9910b750d8aa7895a0e77:/keywords.pl diff --git a/keywords.pl b/keywords.pl index aebb3ee..7ce010e 100755 --- a/keywords.pl +++ b/keywords.pl @@ -1,23 +1,59 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w +# +# Regenerate (overwriting only if changed): +# +# keywords.h +# +# from information stored in the DATA section of this file. +# +# Accepts the standard regen_lib -q and -v args. +# +# This script is normally invoked from regen.pl. -unlink "keywords.h"; -open(KW, ">keywords.h") || die "Can't create keywords.h: $!\n"; -select KW; +use strict; + +require 'regen_lib.pl'; + +my $kw = safer_open("keywords.h-new"); +select $kw; + +print <) { chop; next unless $_; next if /^#/; - ($keyword) = split; + my ($keyword) = split; print &tab(5, "#define KEY_$keyword"), $keynum++, "\n"; } +print $kw "\n/* ex: set ro: */\n"; + +safer_close($kw); + +rename_if_different("keywords.h-new", "keywords.h"); + ########################################################################### sub tab { - local($l, $t) = @_; + my ($l, $t) = @_; $t .= "\t" x ($l - (length($t) + 1) / 8); $t; } @@ -32,15 +68,12 @@ __DATA__ __END__ AUTOLOAD BEGIN +UNITCHECK CORE DESTROY END -EQ -GE -GT -LE -LT -NE +INIT +CHECK abs accept alarm @@ -49,6 +82,7 @@ atan2 bind binmode bless +break caller chdir chmod @@ -66,6 +100,7 @@ cos crypt dbmclose dbmopen +default defined delete die @@ -122,6 +157,7 @@ getservbyport getservent getsockname getsockopt +given glob gmtime goto @@ -144,6 +180,7 @@ link listen local localtime +lock log lstat lt @@ -164,6 +201,7 @@ open opendir or ord +our pack package pipe @@ -175,6 +213,7 @@ prototype push q qq +qr quotemeta qw qx @@ -196,6 +235,7 @@ rewinddir rindex rmdir s +say scalar seek seekdir @@ -230,6 +270,7 @@ sprintf sqrt srand stat +state study sub substr @@ -266,6 +307,7 @@ wait waitpid wantarray warn +when while write x