зеркало из https://github.com/github/ruby.git
* common.mk (parse.c): generates parse.h together.
* id.c, id.h: use constants for parser tokens. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
cc77f676f4
Коммит
ab0ee1d5e9
|
@ -1,3 +1,9 @@
|
|||
Wed Aug 13 14:00:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* 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 <ko1@atdot.net>
|
||||
|
||||
* 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 > $@.new
|
||||
@$(RM) $@ y.tab.c
|
||||
@$(MV) $@.new $@
|
||||
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
|
||||
|
|
21
id.c
21
id.c
|
@ -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");
|
||||
|
|
42
id.h
42
id.h
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче