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

ruby-changes:26472

From: nobu <ko1@a...>
Date: Fri, 21 Dec 2012 16:38:44 +0900 (JST)
Subject: [ruby-changes:26472] nobu:r38523 (trunk): id.h.tmpl: ID2ATTRSET

nobu	2012-12-21 16:38:11 +0900 (Fri, 21 Dec 2012)

  New Revision: 38523

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

  Log:
    id.h.tmpl: ID2ATTRSET
    
    * template/id.h.tmpl (ID2ATTRSET): compile time constant macro for
      ID_ATTRSET.

  Modified files:
    trunk/ChangeLog
    trunk/defs/id.def
    trunk/template/id.h.tmpl

Index: defs/id.def
===================================================================
--- defs/id.def	(revision 38522)
+++ defs/id.def	(revision 38523)
@@ -72,6 +72,8 @@ predefined.lines.each_with_index do |lin https://github.com/ruby/ruby/blob/trunk/defs/id.def#L72
   when /\A\$(?:\d+|(?!\d)\w+)\z/; global_ids
   when /\A@@(?!\d)\w+\z/; class_ids
   when /\A@(?!\d)\w+\z/; instance_ids
+  when /\A((?!\d)\w+)=\z/
+    KeywordError.raise("use ID2ATTRSET(#{$1}) instead of ATTRSET #{name}", firstline+num)
   else preserved_ids
   end << token
   predefined_ids[token] = name
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38522)
+++ ChangeLog	(revision 38523)
@@ -1,4 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
-Fri Dec 21 16:38:05 2012  Nobuyoshi Nakada  <nobu@r...>
+Fri Dec 21 16:38:08 2012  Nobuyoshi Nakada  <nobu@r...>
+
+	* template/id.h.tmpl (ID2ATTRSET): compile time constant macro for
+	  ID_ATTRSET.
 
 	* defs/id.def (KeywordError): check duplication.
 
Index: template/id.h.tmpl
===================================================================
--- template/id.h.tmpl	(revision 38522)
+++ template/id.h.tmpl	(revision 38523)
@@ -39,6 +39,8 @@ types = ids.keys.grep(/^[A-Z]/) https://github.com/ruby/ruby/blob/trunk/template/id.h.tmpl#L39
 #define ID_JUNK       0x07
 #define ID_INTERNAL   ID_JUNK
 
+#define ID2ATTRSET(id) (((id)&~ID_SCOPE_MASK)|ID_ATTRSET)
+
 #define symIFUNC ID2SYM(idIFUNC)
 #define symCFUNC ID2SYM(idCFUNC)
 

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

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