diff --git a/ChangeLog b/ChangeLog index 648852f146..c57261f43b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +Tue Nov 13 15:26:33 2007 Tanaka Akira + + * lex.c.blt: moved from lex.c. + + * lex.c.src: copied from keywords. This is the source of lex.c.blt. + + * Makefile.in (lex.c): use lex.c.blt if keywords is same as lex.c.src. + + * win32/Makefile.sub (lex.c): re-introduce copy rule. + + * bcc32/Makefile.sub (lex.c): ditto. + + * wince/Makefile.sub (lex.c): ditto. + Tue Nov 13 15:21:52 2007 Koichi Sasada * compile.c (iseq_specialized_instruction): check argc. diff --git a/Makefile.in b/Makefile.in index 6a4720c940..5d9dcf36ef 100644 --- a/Makefile.in +++ b/Makefile.in @@ -168,11 +168,13 @@ $(srcdir)/configure: $(srcdir)/configure.in # * svn checkout generate a file with mtime as current time # * XFS has a mtime with fractional part lex.c: keywords - ( gperf -C -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? > $@.tmp && mv $@.tmp $@ ) || \ - if test -f $@; then \ - touch $@ && echo $@ touched.; \ + if cmp -s $(srcdir)/lex.c.src $?; then \ + cp $(srcdir)/lex.c.blt $@; \ else \ - cp $(srcdir)/lex.c $@ && echo $@ copied.; \ + gperf -C -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? > $@.tmp && \ + mv $@.tmp $@ && \ + cp $? $(srcdir)/lex.c.src && \ + cp $@ $(srcdir)/lex.c.blt; \ fi .y.c: diff --git a/bcc32/Makefile.sub b/bcc32/Makefile.sub index c98876fac1..042debf315 100644 --- a/bcc32/Makefile.sub +++ b/bcc32/Makefile.sub @@ -482,6 +482,9 @@ $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb -so_name=$(RUBY_SO_NAME) \ . $(icondirs) $(srcdir)/win32 +lex.c: {$(srcdir)}lex.c.blt + copy "$(?:/=\)" $@ + post-install-bin:: @$(NULLCMD) post-install-lib:: diff --git a/lex.c b/lex.c.blt similarity index 100% rename from lex.c rename to lex.c.blt diff --git a/lex.c.src b/lex.c.src new file mode 100644 index 0000000000..8741eb46b7 --- /dev/null +++ b/lex.c.src @@ -0,0 +1,50 @@ +%{ +struct kwtable {char *name; int id[2]; enum lex_state_e state;}; +const struct kwtable *rb_reserved_word _((const char *, unsigned int)); +#ifndef RIPPER +%} + +struct kwtable; +%% +__LINE__, {keyword__LINE__, keyword__LINE__}, EXPR_END +__FILE__, {keyword__FILE__, keyword__FILE__}, EXPR_END +BEGIN, {keyword_BEGIN, keyword_BEGIN}, EXPR_END +END, {keyword_END, keyword_END}, EXPR_END +alias, {keyword_alias, keyword_alias}, EXPR_FNAME +and, {keyword_and, keyword_and}, EXPR_VALUE +begin, {keyword_begin, keyword_begin}, EXPR_BEG +break, {keyword_break, keyword_break}, EXPR_MID +case, {keyword_case, keyword_case}, EXPR_VALUE +class, {keyword_class, keyword_class}, EXPR_CLASS +def, {keyword_def, keyword_def}, EXPR_FNAME +defined?, {keyword_defined, keyword_defined}, EXPR_ARG +do, {keyword_do, keyword_do}, EXPR_BEG +else, {keyword_else, keyword_else}, EXPR_BEG +elsif, {keyword_elsif, keyword_elsif}, EXPR_VALUE +end, {keyword_end, keyword_end}, EXPR_END +ensure, {keyword_ensure, keyword_ensure}, EXPR_BEG +false, {keyword_false, keyword_false}, EXPR_END +for, {keyword_for, keyword_for}, EXPR_VALUE +if, {keyword_if, modifier_if}, EXPR_VALUE +in, {keyword_in, keyword_in}, EXPR_VALUE +module, {keyword_module, keyword_module}, EXPR_VALUE +next, {keyword_next, keyword_next}, EXPR_MID +nil, {keyword_nil, keyword_nil}, EXPR_END +not, {keyword_not, keyword_not}, EXPR_VALUE +or, {keyword_or, keyword_or}, EXPR_VALUE +redo, {keyword_redo, keyword_redo}, EXPR_END +rescue, {keyword_rescue, modifier_rescue}, EXPR_MID +retry, {keyword_retry, keyword_retry}, EXPR_END +return, {keyword_return, keyword_return}, EXPR_MID +self, {keyword_self, keyword_self}, EXPR_END +super, {keyword_super, keyword_super}, EXPR_ARG +then, {keyword_then, keyword_then}, EXPR_BEG +true, {keyword_true, keyword_true}, EXPR_END +undef, {keyword_undef, keyword_undef}, EXPR_FNAME +unless, {keyword_unless, modifier_unless}, EXPR_VALUE +until, {keyword_until, modifier_until}, EXPR_VALUE +when, {keyword_when, keyword_when}, EXPR_VALUE +while, {keyword_while, modifier_while}, EXPR_VALUE +yield, {keyword_yield, keyword_yield}, EXPR_ARG +%% +#endif diff --git a/win32/Makefile.sub b/win32/Makefile.sub index efdeaae049..3cdf43207e 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -575,6 +575,9 @@ $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: $(RBCONFIG) .rc.res: $(RC) -I. -I$( $@ diff --git a/wince/Makefile.sub b/wince/Makefile.sub index 56ee9050cd..8107c75b13 100644 --- a/wince/Makefile.sub +++ b/wince/Makefile.sub @@ -527,6 +527,9 @@ end .rc.res: $(RC) -I. -I$( $@