[前][次][番号順一覧][スレッド一覧]

ruby-changes:22956

From: nobu <ko1@a...>
Date: Wed, 14 Mar 2012 10:35:17 +0900 (JST)
Subject: [ruby-changes:22956] nobu:r35005 (trunk): method_ids

nobu	2012-03-14 10:35:06 +0900 (Wed, 14 Mar 2012)

  New Revision: 35005

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35005

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

  Modified files:
    trunk/template/id.h.tmpl

Index: template/id.h.tmpl
===================================================================
--- template/id.h.tmpl	(revision 35004)
+++ template/id.h.tmpl	(revision 35005)
@@ -31,6 +31,21 @@
     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
@@ -91,18 +106,9 @@
     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,
@@ -113,18 +119,9 @@
     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)
 };
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]