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

ruby-changes:48898

From: yui-knk <ko1@a...>
Date: Tue, 5 Dec 2017 08:59:07 +0900 (JST)
Subject: [ruby-changes:48898] yui-knk:r61016 (trunk): parse.y: Fix locations of NODE_*ASGN and NODE_ERRINFO

yui-knk	2017-12-05 08:59:02 +0900 (Tue, 05 Dec 2017)

  New Revision: 61016

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

  Log:
    parse.y: Fix locations of NODE_*ASGN and NODE_ERRINFO
    
    * parse.y: Fix to only include a range of exc_var.
    
      e.g. The locations of the NODE_DASGN_CURR and NODE_ERRINFO are fixed:
    
      ```
      begin
        1
      rescue => e
        2
      end
      ```
    
      * Before
    
      ```
      NODE_DASGN_CURR (line: 3, first_lineno: 3, first_column: 0, last_lineno: 5, last_column: 3)
      NODE_ERRINFO (line: 5, first_lineno: 3, first_column: 0, last_lineno: 5, last_column: 3)
      ```
    
      * After
    
      ```
      NODE_DASGN_CURR (line: 3, first_lineno: 3, first_column: 7, last_lineno: 3, last_column: 11)
      NODE_ERRINFO (line: 5, first_lineno: 3, first_column: 7, last_lineno: 3, last_column: 11)
      ```

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 61015)
+++ parse.y	(revision 61016)
@@ -3832,7 +3832,7 @@ opt_rescue	: keyword_rescue exc_list exc https://github.com/ruby/ruby/blob/trunk/parse.y#L3832
 		    {
 		    /*%%%*/
 			if ($3) {
-			    $3 = node_assign($3, new_errinfo(&@$), &@$);
+			    $3 = node_assign($3, new_errinfo(&@3), &@3);
 			    $5 = block_append($3, $5, &@$);
 			}
 			$$ = new_resbody($2, $5, $6, &@$);

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

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