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

ruby-changes:34281

From: nobu <ko1@a...>
Date: Fri, 6 Jun 2014 16:54:58 +0900 (JST)
Subject: [ruby-changes:34281] nobu:r46362 (trunk): parse.y: attr_receiver

nobu	2014-06-06 16:54:37 +0900 (Fri, 06 Jun 2014)

  New Revision: 46362

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

  Log:
    parse.y: attr_receiver
    
    * parse.y (aryset_gen): use `attr_receiver()`.

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 46361)
+++ parse.y	(revision 46362)
@@ -444,6 +444,7 @@ static NODE *aryset_gen(struct parser_pa https://github.com/ruby/ruby/blob/trunk/parse.y#L444
 #define aryset(node1,node2) aryset_gen(parser, (node1), (node2))
 static NODE *attrset_gen(struct parser_params*,NODE*,ID);
 #define attrset(node,id) attrset_gen(parser, (node), (id))
+static inline NODE *attr_receiver(NODE *recv);
 
 static void rb_backref_error_gen(struct parser_params*,NODE*);
 #define rb_backref_error(n) rb_backref_error_gen(parser,(n))
@@ -8824,8 +8825,7 @@ new_bv_gen(struct parser_params *parser, https://github.com/ruby/ruby/blob/trunk/parse.y#L8825
 static NODE *
 aryset_gen(struct parser_params *parser, NODE *recv, NODE *idx)
 {
-    if (recv && nd_type(recv) == NODE_SELF)
-	recv = (NODE *)1;
+    recv = attr_receiver(recv);
     return NEW_ATTRASGN(recv, tASET, idx);
 }
 

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

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