X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=keywords.pl;h=6ede80524cc875b6c70b232d97c2d5bafa959051;hb=9f2f055aa1e8c86d97b5ea42473ab1747f518f3a;hp=d1db4615ad2c26c78110a9c88355f5308aa918f0;hpb=7d07dbc24d4d5bd5fee59acddff905153f4258bd;p=p5sagit%2Fp5-mst-13.2.git diff --git a/keywords.pl b/keywords.pl index d1db461..6ede805 100755 --- a/keywords.pl +++ b/keywords.pl @@ -1,23 +1,48 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w +use strict; -unlink "keywords.h"; -open(KW, ">keywords.h") || die "Can't create keywords.h: $!\n"; -select KW; +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,16 +57,12 @@ __DATA__ __END__ AUTOLOAD BEGIN +UNITCHECK CORE DESTROY END -EQ -GE -GT INIT -LE -LT -NE +CHECK abs accept alarm @@ -50,6 +71,7 @@ atan2 bind binmode bless +break caller chdir chmod @@ -67,6 +89,7 @@ cos crypt dbmclose dbmopen +default defined delete die @@ -123,6 +146,7 @@ getservbyport getservent getsockname getsockopt +given glob gmtime goto @@ -166,6 +190,7 @@ open opendir or ord +our pack package pipe @@ -177,6 +202,7 @@ prototype push q qq +qr quotemeta qw qx @@ -198,6 +224,7 @@ rewinddir rindex rmdir s +say scalar seek seekdir @@ -232,6 +259,7 @@ sprintf sqrt srand stat +state study sub substr @@ -268,6 +296,7 @@ wait waitpid wantarray warn +when while write x