diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-13 05:00:26 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-13 05:00:26 +0000 |
commit | 79dda31740e743e19f10545e6849dee69895c794 (patch) | |
tree | 58308c38a799308d52410ec93ffe9d2d411468ee | |
parent | 156f7cce93dfecbcd583b07c9b48aed856b63e81 (diff) | |
download | ruby-79dda31740e743e19f10545e6849dee69895c794.tar.gz ruby-79dda31740e743e19f10545e6849dee69895c794.tar.xz ruby-79dda31740e743e19f10545e6849dee69895c794.zip |
* common.mk (parse.c): generates parse.h together.
* id.c, id.h: use constants for parser tokens.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | common.mk | 6 | ||||
-rw-r--r-- | id.c | 21 | ||||
-rw-r--r-- | id.h | 42 |
4 files changed, 35 insertions, 40 deletions
@@ -1,3 +1,9 @@ +Wed Aug 13 14:00:19 2008 Nobuyoshi Nakada <[email protected]> + + * common.mk (parse.c): generates parse.h together. + + * id.c, id.h: use constants for parser tokens. + Wed Aug 13 13:47:05 2008 Koichi Sasada <[email protected]> * vm.c: rewind cfp to show proper backtrace. @@ -392,10 +392,12 @@ PHONY: {$(VPATH)}parse.c: {$(VPATH)}parse.y $(srcdir)/tool/ytab.sed {$(srcdir)}.y.c: - $(YACC) $(YFLAGS) -o y.tab.c $< + $(YACC) -d $(YFLAGS) -o y.tab.c $< sed -f $(srcdir)/tool/ytab.sed -e "/^#/s!y\.tab\.c!$@!" y.tab.c > [email protected] - @$(RM) $@ y.tab.c @$(MV) [email protected] $@ + sed -e "/^#/s!y\.tab\.h!$(@:.c=.h)!" y.tab.h > $(@:.c=.h).new + @$(MV) $(@:.c=.h).new $(@:.c=.h) + @$(RM) y.tab.c y.tab.h acosh.$(OBJEXT): {$(VPATH)}acosh.c alloca.$(OBJEXT): {$(VPATH)}alloca.c {$(VPATH)}config.h @@ -11,6 +11,7 @@ #include "ruby/ruby.h" +#define YYSTYPE_IS_DECLARED #define extern #include "id.h" #undef extern @@ -25,26 +26,6 @@ Init_id(void) symCFUNC = ID2SYM(rb_intern("<CFUNC>")); /* IDs */ - idPLUS = rb_intern("+"); - idMINUS = rb_intern("-"); - idMULT = rb_intern("*"); - idDIV = rb_intern("/"); - idMOD = rb_intern("%"); - idLT = rb_intern("<"); - idLTLT = rb_intern("<<"); - idLE = rb_intern("<="); - idGT = rb_intern(">"); - idGE = rb_intern(">="); - idEq = rb_intern("=="); - idEqq = rb_intern("==="); - idBackquote = rb_intern("`"); - idEqTilde = rb_intern("=~"); - idNot = rb_intern("!"); - idNeq = rb_intern("!="); - - idAREF = rb_intern("[]"); - idASET = rb_intern("[]="); - idEach = rb_intern("each"); idTimes = rb_intern("times"); idLength = rb_intern("length"); @@ -12,28 +12,34 @@ #ifndef RUBY_ID_H #define RUBY_ID_H +#include "parse.h" + extern VALUE symIFUNC; extern VALUE symCFUNC; -extern ID idPLUS; -extern ID idMINUS; -extern ID idMULT; -extern ID idDIV; -extern ID idMOD; -extern ID idLT; -extern ID idLTLT; -extern ID idLE; -extern ID idGT; -extern ID idGE; -extern ID idEq; -extern ID idEqq; -extern ID idNeq; -extern ID idNot; -extern ID idBackquote; -extern ID idEqTilde; +enum ruby_method_ids { + idPLUS = '+', + idMINUS = '-', + idMULT = '*', + idDIV = '/', + idMOD = '%', + idLT = '<', + idLTLT = tLSHFT, + idLE = tLEQ, + idGT = '>', + idGE = tGEQ, + idEq = tEQ, + idEqq = tEQQ, + idNeq = tNEQ, + idNot = '!', + idBackquote = '`', + idEqTilde = tMATCH, + idAREF = tAREF, + idASET = tASET, + idDummy +}; + extern ID idThrowState; -extern ID idAREF; -extern ID idASET; extern ID idIntern; extern ID idMethodMissing; extern ID idLength; |