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

ruby-changes:49011

From: yui-knk <ko1@a...>
Date: Tue, 12 Dec 2017 09:28:34 +0900 (JST)
Subject: [ruby-changes:49011] yui-knk:r61130 (trunk): parse.y: Fix locations of NODE_ARRAY in NODE_CALL(:=~)

yui-knk	2017-12-12 09:28:29 +0900 (Tue, 12 Dec 2017)

  New Revision: 61130

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

  Log:
    parse.y: Fix locations of NODE_ARRAY in NODE_CALL(:=~)
    
    * parse.y (match_op_gen): Fix to only include a range of node2.
    
      e.g. The locations of the NODE_ARRAY is fixed:
    
      ```
      re =~ s1
      ```
    
      * Before
    
      ```
      NODE_ARRAY (line: 1, code_range: (1,0)-(1,8))
      ```
    
      * After
    
      ```
      NODE_ARRAY (line: 1, code_range: (1,6)-(1,8))
      ```

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 61129)
+++ parse.y	(revision 61130)
@@ -9306,7 +9306,7 @@ match_op_gen(struct parser_params *parse https://github.com/ruby/ruby/blob/trunk/parse.y#L9306
 	}
     }
 
-    n = new_call(node1, tMATCH, new_list(node2, location), location);
+    n = new_call(node1, tMATCH, new_list(node2, &node2->nd_loc), location);
     nd_set_line(n, line);
     return n;
 }

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

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