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

ruby-changes:48477

From: yui-knk <ko1@a...>
Date: Tue, 31 Oct 2017 22:30:00 +0900 (JST)
Subject: [ruby-changes:48477] yui-knk:r60591 (trunk): node.h: Rename nd_reserved to nd_location

yui-knk	2017-10-31 22:29:54 +0900 (Tue, 31 Oct 2017)

  New Revision: 60591

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60591

  Log:
    node.h: Rename nd_reserved to nd_location
    
    * node.h (RNode): Now nd_reserved is used to store location
      information, so rename nd_reserved to nd_location.

  Modified files:
    trunk/node.h
Index: node.h
===================================================================
--- node.h	(revision 60590)
+++ node.h	(revision 60591)
@@ -224,7 +224,7 @@ enum node_type { https://github.com/ruby/ruby/blob/trunk/node.h#L224
 
 typedef struct RNode {
     VALUE flags;
-    VALUE nd_reserved;		/* ex nd_file */
+    VALUE nd_location;		/* lineno and column */
     union {
 	struct RNode *node;
 	ID id;
@@ -270,13 +270,13 @@ typedef struct RNode { https://github.com/ruby/ruby/blob/trunk/node.h#L270
 #define nd_line(n) (int)(((SIGNED_VALUE)RNODE(n)->flags)>>NODE_LSHIFT)
 #define nd_set_line(n,l) \
     RNODE(n)->flags=((RNODE(n)->flags&~((VALUE)(-1)<<NODE_LSHIFT))|((VALUE)((l)&NODE_LMASK)<<NODE_LSHIFT))
-#define nd_column(n) (int)(RNODE(n)->nd_reserved & 0xffff)
+#define nd_column(n) (int)(RNODE(n)->nd_location & 0xffff)
 #define nd_set_column(n, v) \
-    RNODE(n)->nd_reserved = (RNODE(n)->nd_reserved & ~0xffff) | ((v) > 0xffff ? 0xffff : ((unsigned int)(v)) & 0xffff)
+    RNODE(n)->nd_location = (RNODE(n)->nd_location & ~0xffff) | ((v) > 0xffff ? 0xffff : ((unsigned int)(v)) & 0xffff)
 
-#define nd_lineno(n) (int)((RNODE(n)->nd_reserved >> 16) & 0xffff)
+#define nd_lineno(n) (int)((RNODE(n)->nd_location >> 16) & 0xffff)
 #define nd_set_lineno(n, v) \
-    RNODE(n)->nd_reserved = (RNODE(n)->nd_reserved & ~0xffff0000) | (((v) > 0xffff ? 0xffff : ((unsigned int)(v)) & 0xffff) << 16)
+    RNODE(n)->nd_location = (RNODE(n)->nd_location & ~0xffff0000) | (((v) > 0xffff ? 0xffff : ((unsigned int)(v)) & 0xffff) << 16)
 
 #define nd_head  u1.node
 #define nd_alen  u2.argc

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

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