This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Return OPERATOR('[') for '[' without falling through to case '~', avoiding misinterpr...
[perl5.git]
/
keywords.pl
diff --git
a/keywords.pl
b/keywords.pl
index
02f3ff8
..
6ede805
100755
(executable)
--- a/
keywords.pl
+++ b/
keywords.pl
@@
-1,14
+1,18
@@
-#!/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 <<EOM;
print <<EOM;
-/*
+/* -*- buffer-read-only: t -*-
+ *
* keywords.h
*
* keywords.h
*
- * Copyright (c) 1997-2002, Larry Wall
+ * Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2005,
+ * 2006, 2007, by Larry Wall and others
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
@@
-21,18
+25,24
@@
EOM
# Read & print data.
# Read & print data.
-$keynum = 0;
+
my
$keynum = 0;
while (<DATA>) {
chop;
next unless $_;
next if /^#/;
while (<DATA>) {
chop;
next unless $_;
next if /^#/;
- ($keyword) = split;
+
my
($keyword) = split;
print &tab(5, "#define KEY_$keyword"), $keynum++, "\n";
}
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 {
###########################################################################
sub tab {
-
local
($l, $t) = @_;
+
my
($l, $t) = @_;
$t .= "\t" x ($l - (length($t) + 1) / 8);
$t;
}
$t .= "\t" x ($l - (length($t) + 1) / 8);
$t;
}
@@
-47,6
+57,7
@@
__DATA__
__END__
AUTOLOAD
BEGIN
__END__
AUTOLOAD
BEGIN
+UNITCHECK
CORE
DESTROY
END
CORE
DESTROY
END
@@
-60,6
+71,7
@@
atan2
bind
binmode
bless
bind
binmode
bless
+break
caller
chdir
chmod
caller
chdir
chmod
@@
-77,6
+89,7
@@
cos
crypt
dbmclose
dbmopen
crypt
dbmclose
dbmopen
+default
defined
delete
die
defined
delete
die
@@
-133,6
+146,7
@@
getservbyport
getservent
getsockname
getsockopt
getservent
getsockname
getsockopt
+given
glob
gmtime
goto
glob
gmtime
goto
@@
-210,6
+224,7
@@
rewinddir
rindex
rmdir
s
rindex
rmdir
s
+say
scalar
seek
seekdir
scalar
seek
seekdir
@@
-244,6
+259,7
@@
sprintf
sqrt
srand
stat
sqrt
srand
stat
+state
study
sub
substr
study
sub
substr
@@
-280,6
+296,7
@@
wait
waitpid
wantarray
warn
waitpid
wantarray
warn
+when
while
write
x
while
write
x