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

ruby-changes:48890

From: yui-knk <ko1@a...>
Date: Mon, 4 Dec 2017 16:16:36 +0900 (JST)
Subject: [ruby-changes:48890] yui-knk:r61008 (trunk): parse.y: Fix a location of NODE_ARRAY in NODE_ARGSCAT

yui-knk	2017-12-04 16:16:31 +0900 (Mon, 04 Dec 2017)

  New Revision: 61008

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

  Log:
    parse.y: Fix a location of NODE_ARRAY in NODE_ARGSCAT
    
    * parse.y: Fix the first location to be equal to the location
      of the first element of NODE_ARRAY.
    
      e.g. The locations of the NODE_ARRAY is fixed:
    
      ```
      m(*a, :b, :c)
      ```
    
      * Before
    
      ```
      NODE_ARRAY (line: 1, first_lineno: 1, first_column: 2, last_lineno: 1, last_column: 12)
      ```
    
      * After
    
      ```
      NODE_ARRAY (line: 1, first_lineno: 1, first_column: 6, last_lineno: 1, last_column: 12)
      ```

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 61007)
+++ parse.y	(revision 61008)
@@ -10060,7 +10060,7 @@ arg_append_gen(struct parser_params *par https://github.com/ruby/ruby/blob/trunk/parse.y#L10060
 	node1->nd_head = arg_append(node1->nd_head, node2, location);
 	return node1;
       case NODE_ARGSPUSH:
-	node1->nd_body = list_append(new_list(node1->nd_body, location), node2, location);
+	node1->nd_body = list_append(new_list(node1->nd_body, &node1->nd_body->nd_loc), node2, location);
 	nd_set_type(node1, NODE_ARGSCAT);
 	return node1;
     }

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

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