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

ruby-changes:48971

From: yui-knk <ko1@a...>
Date: Sat, 9 Dec 2017 12:19:01 +0900 (JST)
Subject: [ruby-changes:48971] yui-knk:r61090 (trunk): parse.y: Fix locations of NODE_ARRAY in NODE_OPCALL(nd_args)

yui-knk	2017-12-09 12:18:55 +0900 (Sat, 09 Dec 2017)

  New Revision: 61090

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

  Log:
    parse.y: Fix locations of NODE_ARRAY in NODE_OPCALL(nd_args)
    
    * parse.y: Fix to only include a range of arg1.
    
      e.g. The locations of the NODE_ARRAY is fixed:
    
      ```
      1 + 2
      ```
    
      * Before
    
      ```
      NODE_ARRAY (line: 1, code_range: (1,0)-(1,5))
      ```
    
      * After
    
      ```
      NODE_ARRAY (line: 1, code_range: (1,4)-(1,5))
      ```

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 61089)
+++ parse.y	(revision 61090)
@@ -9223,7 +9223,7 @@ call_bin_op_gen(struct parser_params *pa https://github.com/ruby/ruby/blob/trunk/parse.y#L9223
     NODE *expr;
     value_expr(recv);
     value_expr(arg1);
-    expr = NEW_OPCALL(recv, id, new_list(arg1, location));
+    expr = NEW_OPCALL(recv, id, new_list(arg1, &arg1->nd_loc));
     nd_set_line(expr, op_loc->first_loc.lineno);
     expr->nd_loc = *location;
     return expr;

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

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