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

ruby-changes:48841

From: yui-knk <ko1@a...>
Date: Fri, 1 Dec 2017 15:33:03 +0900 (JST)
Subject: [ruby-changes:48841] yui-knk:r60958 (trunk): parse.y: Fix a location of hash keys

yui-knk	2017-12-01 15:32:59 +0900 (Fri, 01 Dec 2017)

  New Revision: 60958

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

  Log:
    parse.y: Fix a location of hash keys
    
    * parse.y: Use @1 to only include a range of tLABEL.
    
      e.g. The locations of the NODE_LIT(:b) is fixed:
    
      ```
      a(1, b: 10)
      ```
    
      * Before
    
      ```
      NODE_LIT (line: 1, first_lineno: 1, first_column: 5, last_lineno: 1, last_column: 10)
      ```
    
      * After
    
      ```
      NODE_LIT (line: 1, first_lineno: 1, first_column: 5, last_lineno: 1, last_column: 7)
      ```

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 60957)
+++ parse.y	(revision 60958)
@@ -4983,7 +4983,7 @@ assoc		: arg_value tASSOC arg_value https://github.com/ruby/ruby/blob/trunk/parse.y#L4983
 		| tLABEL arg_value
 		    {
 		    /*%%%*/
-			$$ = list_append(new_list(new_lit(ID2SYM($1), &@$), &@$), $2, &@$);
+			$$ = list_append(new_list(new_lit(ID2SYM($1), &@1), &@$), $2, &@$);
 		    /*%
 			$$ = dispatch2(assoc_new, $1, $2);
 		    %*/

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

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