mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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:
parent
cc77f676f4
commit
ab0ee1d5e9
4 changed files with 35 additions and 40 deletions
|
@ -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>
|
Wed Aug 13 13:47:05 2008 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* vm.c: rewind cfp to show proper backtrace.
|
* vm.c: rewind cfp to show proper backtrace.
|
||||||
|
|
|
@ -392,10 +392,12 @@ PHONY:
|
||||||
{$(VPATH)}parse.c: {$(VPATH)}parse.y $(srcdir)/tool/ytab.sed
|
{$(VPATH)}parse.c: {$(VPATH)}parse.y $(srcdir)/tool/ytab.sed
|
||||||
|
|
||||||
{$(srcdir)}.y.c:
|
{$(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
|
sed -f $(srcdir)/tool/ytab.sed -e "/^#/s!y\.tab\.c!$@!" y.tab.c > $@.new
|
||||||
@$(RM) $@ y.tab.c
|
|
||||||
@$(MV) $@.new $@
|
@$(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
|
acosh.$(OBJEXT): {$(VPATH)}acosh.c
|
||||||
alloca.$(OBJEXT): {$(VPATH)}alloca.c {$(VPATH)}config.h
|
alloca.$(OBJEXT): {$(VPATH)}alloca.c {$(VPATH)}config.h
|
||||||
|
|
21
id.c
21
id.c
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
#include "ruby/ruby.h"
|
#include "ruby/ruby.h"
|
||||||
|
|
||||||
|
#define YYSTYPE_IS_DECLARED
|
||||||
#define extern
|
#define extern
|
||||||
#include "id.h"
|
#include "id.h"
|
||||||
#undef extern
|
#undef extern
|
||||||
|
@ -25,26 +26,6 @@ Init_id(void)
|
||||||
symCFUNC = ID2SYM(rb_intern("<CFUNC>"));
|
symCFUNC = ID2SYM(rb_intern("<CFUNC>"));
|
||||||
|
|
||||||
/* IDs */
|
/* 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");
|
idEach = rb_intern("each");
|
||||||
idTimes = rb_intern("times");
|
idTimes = rb_intern("times");
|
||||||
idLength = rb_intern("length");
|
idLength = rb_intern("length");
|
||||||
|
|
42
id.h
42
id.h
|
@ -12,28 +12,34 @@
|
||||||
#ifndef RUBY_ID_H
|
#ifndef RUBY_ID_H
|
||||||
#define RUBY_ID_H
|
#define RUBY_ID_H
|
||||||
|
|
||||||
|
#include "parse.h"
|
||||||
|
|
||||||
extern VALUE symIFUNC;
|
extern VALUE symIFUNC;
|
||||||
extern VALUE symCFUNC;
|
extern VALUE symCFUNC;
|
||||||
|
|
||||||
extern ID idPLUS;
|
enum ruby_method_ids {
|
||||||
extern ID idMINUS;
|
idPLUS = '+',
|
||||||
extern ID idMULT;
|
idMINUS = '-',
|
||||||
extern ID idDIV;
|
idMULT = '*',
|
||||||
extern ID idMOD;
|
idDIV = '/',
|
||||||
extern ID idLT;
|
idMOD = '%',
|
||||||
extern ID idLTLT;
|
idLT = '<',
|
||||||
extern ID idLE;
|
idLTLT = tLSHFT,
|
||||||
extern ID idGT;
|
idLE = tLEQ,
|
||||||
extern ID idGE;
|
idGT = '>',
|
||||||
extern ID idEq;
|
idGE = tGEQ,
|
||||||
extern ID idEqq;
|
idEq = tEQ,
|
||||||
extern ID idNeq;
|
idEqq = tEQQ,
|
||||||
extern ID idNot;
|
idNeq = tNEQ,
|
||||||
extern ID idBackquote;
|
idNot = '!',
|
||||||
extern ID idEqTilde;
|
idBackquote = '`',
|
||||||
|
idEqTilde = tMATCH,
|
||||||
|
idAREF = tAREF,
|
||||||
|
idASET = tASET,
|
||||||
|
idDummy
|
||||||
|
};
|
||||||
|
|
||||||
extern ID idThrowState;
|
extern ID idThrowState;
|
||||||
extern ID idAREF;
|
|
||||||
extern ID idASET;
|
|
||||||
extern ID idIntern;
|
extern ID idIntern;
|
||||||
extern ID idMethodMissing;
|
extern ID idMethodMissing;
|
||||||
extern ID idLength;
|
extern ID idLength;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue