method_ids

* template/id.h.tmpl (method_ids): define at once predefined method IDs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-03-14 01:35:06 +00:00
parent 6b4525912b
commit 48f9f0bda9

View File

@ -31,6 +31,21 @@ vpath.find do |dir|
true true
end end
end end
method_ids = %w[
Intern
MethodMissing
Length
Size
Gets
Succ
Each
Lambda
Send
__send__
Initialize
UScore
]
%> %>
#ifndef RUBY_ID_H #ifndef RUBY_ID_H
#define RUBY_ID_H #define RUBY_ID_H
@ -91,18 +106,9 @@ enum ruby_method_ids {
idAREF = tAREF, idAREF = tAREF,
idASET = tASET, idASET = tASET,
idLAST_TOKEN = tLAST_TOKEN >> ID_SCOPE_SHIFT, idLAST_TOKEN = tLAST_TOKEN >> ID_SCOPE_SHIFT,
tIntern, % method_ids.each do |token|
tMethodMissing, t<%=token%>,
tLength, % end
tSize,
tGets,
tSucc,
tEach,
tLambda,
tSend,
t__send__,
tInitialize,
tUScore,
#if SUPPORT_JOKE #if SUPPORT_JOKE
tBitblt, tBitblt,
tAnswer, tAnswer,
@ -113,18 +119,9 @@ enum ruby_method_ids {
TOKEN2ID(Bitblt), TOKEN2ID(Bitblt),
TOKEN2ID(Answer), TOKEN2ID(Answer),
#endif #endif
TOKEN2ID(Intern), % method_ids.each do |token|
TOKEN2ID(MethodMissing), TOKEN2ID(<%=token%>),
TOKEN2ID(Length), % end
TOKEN2ID(Size),
TOKEN2ID(Gets),
TOKEN2ID(Succ),
TOKEN2ID(Each),
TOKEN2ID(Lambda),
TOKEN2ID(Send),
TOKEN2ID(__send__),
TOKEN2ID(Initialize),
TOKEN2ID(UScore),
TOKEN2ID(LAST_ID) TOKEN2ID(LAST_ID)
}; };