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

ruby-changes:48750

From: yui-knk <ko1@a...>
Date: Tue, 21 Nov 2017 08:12:50 +0900 (JST)
Subject: [ruby-changes:48750] yui-knk:r60866 (trunk): parse.y: Fix the last location of NODE_LIT in %i

yui-knk	2017-11-21 08:12:43 +0900 (Tue, 21 Nov 2017)

  New Revision: 60866

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

  Log:
    parse.y: Fix the last location of NODE_LIT in %i
    
      * parse.y: Use @2 to not include a range of ' '.
    
      e.g. The locations of NODE_LIT is fixed:
    
      ```
      %i[a]
      ```
    
      * Before
    
      ```
      NODE_LIT (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 5)
      ```
    
      * After
    
      ```
      NODE_LIT (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 4)
      ```

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 60865)
+++ parse.y	(revision 60866)
@@ -4124,7 +4124,7 @@ qsym_list	: /* none */ https://github.com/ruby/ruby/blob/trunk/parse.y#L4124
 			lit = $2->nd_lit;
 			nd_set_type($2, NODE_LIT);
 			add_mark_object($2->nd_lit = ID2SYM(rb_intern_str(lit)));
-			$2->nd_loc = @$;
+			$2->nd_loc = @2;
 			$$ = list_append($1, $2, &@$);
 		    /*%
 			$$ = dispatch2(qsymbols_add, $1, $2);

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

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