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

ruby-changes:48892

From: yui-knk <ko1@a...>
Date: Mon, 4 Dec 2017 16:50:46 +0900 (JST)
Subject: [ruby-changes:48892] yui-knk:r61010 (trunk): parse.y: Fix a location of NODE_ARGSCAT

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

  New Revision: 61010

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

  Log:
    parse.y: Fix a location of NODE_ARGSCAT
    
    * parse.y (arg_append_gen): Update the last location of
      NODE_ARGSCAT when NODE is appended to nd_body.
    
      e.g. The locations of the NODE_ARGSCAT is fixed:
    
      ```
      m(*a, :b, :c)
      ```
    
      * Before
    
      ```
      NODE_ARGSCAT (line: 1, first_lineno: 1, first_column: 2, last_lineno: 1, last_column: 8)
      ```
    
      * After
    
      ```
      NODE_ARGSCAT (line: 1, first_lineno: 1, first_column: 2, last_lineno: 1, last_column: 12)
      ```

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 61009)
+++ parse.y	(revision 61010)
@@ -10061,6 +10061,7 @@ arg_append_gen(struct parser_params *par https://github.com/ruby/ruby/blob/trunk/parse.y#L10061
 	return node1;
       case NODE_ARGSPUSH:
 	node1->nd_body = list_append(new_list(node1->nd_body, &node1->nd_body->nd_loc), node2, location);
+	node1->nd_loc.last_loc = node1->nd_body->nd_loc.last_loc;
 	nd_set_type(node1, NODE_ARGSCAT);
 	return node1;
     }

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

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