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

ruby-changes:48720

From: yui-knk <ko1@a...>
Date: Sat, 18 Nov 2017 17:21:51 +0900 (JST)
Subject: [ruby-changes:48720] yui-knk:r60836 (trunk): parse.y: Fix the locations of NODE_DVAR and NODE_LVAR

yui-knk	2017-11-18 17:21:46 +0900 (Sat, 18 Nov 2017)

  New Revision: 60836

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

  Log:
    parse.y: Fix the locations of NODE_DVAR and NODE_LVAR
    
      * parse.y: Fix the locations of NODE_DVAR and NODE_LVAR
        when it's a multiple assignment method parameter.
    
      e.g. The locations of NODE_DVAR is fixed:
    
      ```
      a {|(b, c)| d}
      ```
    
      * Before
    
      ```
      NODE_DVAR (line: 1, first_lineno: 1, first_column: 4, last_lineno: 1, last_column: 10)
      ```
    
      * After
    
      ```
      NODE_DVAR (line: 1, first_lineno: 1, first_column: 5, last_lineno: 1, last_column: 9)
      ```

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 60835)
+++ parse.y	(revision 60836)
@@ -4640,10 +4640,10 @@ f_arg_item	: f_arg_asgn https://github.com/ruby/ruby/blob/trunk/parse.y#L4640
 			arg_var(tid);
 		    /*%%%*/
 			if (dyna_in_block()) {
-			    $2->nd_value = new_dvar(tid, &@$);
+			    $2->nd_value = new_dvar(tid, &@2);
 			}
 			else {
-			    $2->nd_value = new_lvar(tid, &@$);
+			    $2->nd_value = new_lvar(tid, &@2);
 			}
 			$$ = NEW_ARGS_AUX(tid, 1);
 			$$->nd_next = $2;

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

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