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

ruby-changes:48882

From: yui-knk <ko1@a...>
Date: Mon, 4 Dec 2017 08:12:06 +0900 (JST)
Subject: [ruby-changes:48882] yui-knk:r61000 (trunk): parse.y: Fix a location of NODE_ZARRAY

yui-knk	2017-12-04 08:12:01 +0900 (Mon, 04 Dec 2017)

  New Revision: 61000

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

  Log:
    parse.y: Fix a location of NODE_ZARRAY
    
    * parse.y: Fix to only include a range of opt_call_args.
    
      e.g. The locations of the NODE_ZARRAY is fixed:
    
      ```
      a[] ||= 1
      ```
    
      * Before
    
      ```
      NODE_ZARRAY (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 9)
      ```
    
      * After
    
      ```
      NODE_ZARRAY (line: 1, first_lineno: 1, first_column: 2, last_lineno: 1, last_column: 3)
      ```

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 60999)
+++ parse.y	(revision 61000)
@@ -1511,7 +1511,7 @@ command_asgn	: lhs '=' command_rhs https://github.com/ruby/ruby/blob/trunk/parse.y#L1511
 			NODE *args;
 
 			value_expr($6);
-			$3 = make_array($3, &@$);
+			$3 = make_array($3, &@3);
 			args = arg_concat($3, $6, &@$);
 			if ($5 == tOROP) {
 			    $5 = 0;
@@ -2161,7 +2161,7 @@ arg		: lhs '=' arg_rhs https://github.com/ruby/ruby/blob/trunk/parse.y#L2161
 			NODE *args;
 
 			value_expr($6);
-			$3 = make_array($3, &@$);
+			$3 = make_array($3, &@3);
 			if (nd_type($3) == NODE_BLOCK_PASS) {
 			    args = NEW_ARGSCAT($3, $6);
 			    args->nd_loc = @$;

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

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