Skip to content

Commit

Permalink
Break out the generated function Perl_keywords() into keywords.c, a n…
Browse files Browse the repository at this point in the history
…ew file.

As it and Perl_yylex() both need FEATURE_IS_ENABLED, feature_is_enabled() is
no longer static, and the two macro definitions move from toke.c to perl.h

Previously, one had to cut and paste the output of perl_keywords.pl into the
middle of toke.c, and it was not clear that it was generated code.
  • Loading branch information
nwc10 committed Jan 24, 2011
1 parent 858e1d2 commit 26ea9e1
Show file tree
Hide file tree
Showing 17 changed files with 3,436 additions and 3,415 deletions.
2 changes: 1 addition & 1 deletion Cross/Makefile-cross-SH
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ h = $(h1) $(h2) $(h3) $(h4) $(h5)
c1 = av.c scope.c op.c doop.c doio.c dump.c gv.c hv.c mg.c reentr.c mro.c perl.c
c2 = perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c sv.c
c3 = taint.c toke.c util.c deb.c run.c universal.c pad.c globals.c
c3 = taint.c toke.c util.c deb.c run.c universal.c pad.c globals.c keywords.c
c4 = perlio.c perlapi.c numeric.c mathoms.c locale.c pp_pack.c pp_sort.c
c5 = $(madlysrc) $(mallocsrc)
Expand Down
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -3765,6 +3765,7 @@ installperl Perl script to do "make install" dirty work
INTERN.h Included before domestic .h files
intrpvar.h Variables held in each interpreter instance
iperlsys.h Perl's interface to the system
keywords.c Perl_keyword(), generated by perl_keyword.pl
keywords.h The keyword numbers
l1_char_class_tab.h 256 word bit table of character classes (for handy.h)
lib/abbrev.pl An abbreviation table builder
Expand Down
4 changes: 2 additions & 2 deletions Makefile.SH
Original file line number Diff line number Diff line change
Expand Up @@ -446,14 +446,14 @@ h = $(h1) $(h2) $(h3) $(h4) $(h5)
c1 = av.c scope.c op.c doop.c doio.c dump.c gv.c hv.c mg.c reentr.c mro.c perl.c
c2 = perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c sv.c
c3 = taint.c toke.c util.c deb.c run.c universal.c pad.c globals.c
c3 = taint.c toke.c util.c deb.c run.c universal.c pad.c globals.c keywords.c
c4 = perlio.c perlapi.c numeric.c mathoms.c locale.c pp_pack.c pp_sort.c
c5 = $(madlysrc) $(mallocsrc)
c = $(c1) $(c2) $(c3) $(c4) $(c5) miniperlmain.c opmini.c perlmini.c
obj0 = op$(OBJ_EXT) perl$(OBJ_EXT)
obj1 = $(madlyobj) $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) pad$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT) reentr$(OBJ_EXT) mro$(OBJ_EXT)
obj1 = $(madlyobj) $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) pad$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT) reentr$(OBJ_EXT) mro$(OBJ_EXT) keywords$(OBJ_EXT)
obj2 = hv$(OBJ_EXT) av$(OBJ_EXT) run$(OBJ_EXT) pp_hot$(OBJ_EXT) sv$(OBJ_EXT) pp$(OBJ_EXT) scope$(OBJ_EXT) pp_ctl$(OBJ_EXT) pp_sys$(OBJ_EXT)
obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) perlapi$(OBJ_EXT) numeric$(OBJ_EXT) mathoms$(OBJ_EXT) locale$(OBJ_EXT) pp_pack$(OBJ_EXT) pp_sort$(OBJ_EXT)
Expand Down
5 changes: 4 additions & 1 deletion Makefile.micro
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ O = uav$(_O) udeb$(_O) udoio$(_O) udoop$(_O) udump$(_O) \
uregcomp$(_O) uregexec$(_O) urun$(_O) \
uscope$(_O) usv$(_O) utaint$(_O) utoke$(_O) \
unumeric$(_O) ulocale$(_O) umathoms$(_O) \
uuniversal$(_O) uutf8$(_O) uutil$(_O) uperlapi$(_O)
uuniversal$(_O) uutf8$(_O) uutil$(_O) uperlapi$(_O) ukeywords$(_O)

microperl: $(O)
$(LD) -o $@ $(O) $(LDFLAGS) $(LIBS)
Expand Down Expand Up @@ -86,6 +86,9 @@ umro$(_O): $(HE) mro.c
uhv$(_O): $(HE) hv.c
$(CC) $(CCFLAGS) -o $@ $(CFLAGS) hv.c

ukeywords$(_O): $(HE) keywords.c
$(CC) $(CCFLAGS) -o $@ $(CFLAGS) keywords.c

umg$(_O): $(HE) mg.c
$(CC) $(CCFLAGS) -o $@ $(CFLAGS) mg.c

Expand Down
1 change: 1 addition & 0 deletions NetWare/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ MICROCORE_SRC = \
..\gv.c \
..\mro.c \
..\hv.c \
..\keywords.c \
..\locale.c \
..\mathoms.c \
..\mg.c \
Expand Down
1 change: 1 addition & 0 deletions Porting/makerel
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ my @writables = qw(
NetWare/config_H.wc
NetWare/Makefile
keywords.h
keywords.c
opcode.h
opnames.h
pp_proto.h
Expand Down
4 changes: 3 additions & 1 deletion embed.fnc
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,6 @@ s |U8* |add_utf16_textfilter|NN U8 *const s|bool reversed
#endif
s |void |checkcomma |NN const char *s|NN const char *name \
|NN const char *what
s |bool |feature_is_enabled|NN const char *const name|STRLEN namelen
s |void |force_ident |NN const char *s|int kind
s |void |incline |NN const char *s
s |int |intuit_method |NN char *s|NULLOK GV *gv|NULLOK CV *cv
Expand Down Expand Up @@ -2422,4 +2421,7 @@ Anop |void |clone_params_del|NN CLONE_PARAMS *param
: Used in perl.c and toke.c
op |void |populate_isa |NN const char *name|STRLEN len|...

: Used in keywords.c and toke.c
op |bool |feature_is_enabled|NN const char *const name|STRLEN namelen

: ex: set ts=8 sts=4 sw=4 noet:
1 change: 0 additions & 1 deletion embed.h
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,6 @@
#define check_uni() S_check_uni(aTHX)
#define checkcomma(a,b,c) S_checkcomma(aTHX_ a,b,c)
#define deprecate_commaless_var_list() S_deprecate_commaless_var_list(aTHX)
#define feature_is_enabled(a,b) S_feature_is_enabled(aTHX_ a,b)
#define filter_gets(a,b) S_filter_gets(aTHX_ a,b)
#define find_in_my_stash(a,b) S_find_in_my_stash(aTHX_ a,b)
#define force_ident(a,b) S_force_ident(aTHX_ a,b)
Expand Down
Loading

0 comments on commit 26ea9e1

Please sign in to comment.