Add a test for [perl #17753].
[p5sagit/p5-mst-13.2.git] / keywords.pl
1 #!/usr/bin/perl
2
3 require 'regen_lib.pl';
4 safer_unlink ("keywords.h");
5 open(KW, ">keywords.h") || die "Can't create keywords.h: $!\n";
6 select KW;
7
8 print <<EOM;
9 /*
10  *    keywords.h
11  *
12  *    Copyright (c) 1997-2002, Larry Wall
13  *
14  *    You may distribute under the terms of either the GNU General Public
15  *    License or the Artistic License, as specified in the README file.
16  *
17  * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
18  *  This file is built by keywords.pl from its data.  Any changes made here
19  *  will be lost!
20  */
21 EOM
22
23 # Read & print data.
24
25 $keynum = 0;
26 while (<DATA>) {
27     chop;
28     next unless $_;
29     next if /^#/;
30     ($keyword) = split;
31     print &tab(5, "#define KEY_$keyword"), $keynum++, "\n";
32 }
33
34 close KW or die "Error closing keywords.h: $!";
35
36 ###########################################################################
37 sub tab {
38     local($l, $t) = @_;
39     $t .= "\t" x ($l - (length($t) + 1) / 8);
40     $t;
41 }
42 ###########################################################################
43 __END__
44
45 NULL
46 __FILE__
47 __LINE__
48 __PACKAGE__
49 __DATA__
50 __END__
51 AUTOLOAD
52 BEGIN
53 CORE
54 DESTROY
55 END
56 INIT
57 CHECK
58 abs
59 accept
60 alarm
61 and
62 atan2
63 bind
64 binmode
65 bless
66 caller
67 chdir
68 chmod
69 chomp
70 chop
71 chown
72 chr
73 chroot
74 close
75 closedir
76 cmp
77 connect
78 continue
79 cos
80 crypt
81 dbmclose
82 dbmopen
83 defined
84 delete
85 die
86 do
87 dump
88 each
89 else
90 elsif
91 endgrent
92 endhostent
93 endnetent
94 endprotoent
95 endpwent
96 endservent
97 eof
98 eq
99 err
100 eval
101 exec
102 exists
103 exit
104 exp
105 fcntl
106 fileno
107 flock
108 for
109 foreach
110 fork
111 format
112 formline
113 ge
114 getc
115 getgrent
116 getgrgid
117 getgrnam
118 gethostbyaddr
119 gethostbyname
120 gethostent
121 getlogin
122 getnetbyaddr
123 getnetbyname
124 getnetent
125 getpeername
126 getpgrp
127 getppid
128 getpriority
129 getprotobyname
130 getprotobynumber
131 getprotoent
132 getpwent
133 getpwnam
134 getpwuid
135 getservbyname
136 getservbyport
137 getservent
138 getsockname
139 getsockopt
140 glob
141 gmtime
142 goto
143 grep
144 gt
145 hex
146 if
147 index
148 int
149 ioctl
150 join
151 keys
152 kill
153 last
154 lc
155 lcfirst
156 le
157 length
158 link
159 listen
160 local
161 localtime
162 lock
163 log
164 lstat
165 lt
166 m
167 map
168 mkdir
169 msgctl
170 msgget
171 msgrcv
172 msgsnd
173 my
174 ne
175 next
176 no
177 not
178 oct
179 open
180 opendir
181 or
182 ord
183 our
184 pack
185 package
186 pipe
187 pop
188 pos
189 print
190 printf
191 prototype
192 push
193 q
194 qq
195 qr
196 quotemeta
197 qw
198 qx
199 rand
200 read
201 readdir
202 readline
203 readlink
204 readpipe
205 recv
206 redo
207 ref
208 rename
209 require
210 reset
211 return
212 reverse
213 rewinddir
214 rindex
215 rmdir
216 s
217 scalar
218 seek
219 seekdir
220 select
221 semctl
222 semget
223 semop
224 send
225 setgrent
226 sethostent
227 setnetent
228 setpgrp
229 setpriority
230 setprotoent
231 setpwent
232 setservent
233 setsockopt
234 shift
235 shmctl
236 shmget
237 shmread
238 shmwrite
239 shutdown
240 sin
241 sleep
242 socket
243 socketpair
244 sort
245 splice
246 split
247 sprintf
248 sqrt
249 srand
250 stat
251 study
252 sub
253 substr
254 symlink
255 syscall
256 sysopen
257 sysread
258 sysseek
259 system
260 syswrite
261 tell
262 telldir
263 tie
264 tied
265 time
266 times
267 tr
268 truncate
269 uc
270 ucfirst
271 umask
272 undef
273 unless
274 unlink
275 unpack
276 unshift
277 untie
278 until
279 use
280 utime
281 values
282 vec
283 wait
284 waitpid
285 wantarray
286 warn
287 while
288 write
289 x
290 xor
291 y