Skip to content

Commit

Permalink
method_ids
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nobu committed Mar 14, 2012
1 parent 6b45259 commit 48f9f0b
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions template/id.h.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ vpath.find do |dir|
true
end
end

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

Expand Down

0 comments on commit 48f9f0b

Please sign in to comment.