parse.y: Fix locations of NODE_ARRAY in NODE_CALL(:=~)

* parse.y (match_op_gen): Fix to only include a range of node2.

  e.g. The locations of the NODE_ARRAY is fixed:

  ```
  re =~ s1
  ```

  * Before

  ```
  NODE_ARRAY (line: 1, code_range: (1,0)-(1,8))
  ```

  * After

  ```
  NODE_ARRAY (line: 1, code_range: (1,6)-(1,8))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yui-knk 2017-12-12 00:28:29 +00:00
parent 9b1d8ab7d0
commit 0b31ce0047

View File

@ -9306,7 +9306,7 @@ match_op_gen(struct parser_params *parser, NODE *node1, NODE *node2, const YYLTY
}
}
n = new_call(node1, tMATCH, new_list(node2, location), location);
n = new_call(node1, tMATCH, new_list(node2, &node2->nd_loc), location);
nd_set_line(n, line);
return n;
}