parse.y: Fix a location of NODE_HASH

* parse.y: Fix to only include a range of assocs.

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

  ```
  a(1, b: 10, &block)
  ```

  * Before

  ```
  NODE_HASH (line: 1, first_lineno: 1, first_column: 2, last_lineno: 1, last_column: 18)
  ```

  * After

  ```
  NODE_HASH (line: 1, first_lineno: 1, first_column: 5, last_lineno: 1, last_column: 10)
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yui-knk 2017-12-01 09:48:17 +00:00
Родитель b35f6f04f3
Коммит 58d572d6aa
1 изменённых файлов: 6 добавлений и 6 удалений

12
parse.y
Просмотреть файл

@ -2389,7 +2389,7 @@ aref_args : none
| args ',' assocs trailer
{
/*%%%*/
$$ = $3 ? arg_append($1, new_hash($3, &@$), &@$) : $1;
$$ = $3 ? arg_append($1, new_hash($3, &@3), &@$) : $1;
/*%
$$ = arg_add_assocs($1, $3);
%*/
@ -2397,7 +2397,7 @@ aref_args : none
| assocs trailer
{
/*%%%*/
$$ = $1 ? new_list(new_hash($1, &@$), &@$) : 0;
$$ = $1 ? new_list(new_hash($1, &@1), &@$) : 0;
/*%
$$ = arg_add_assocs(arg_new(), $1);
%*/
@ -2446,7 +2446,7 @@ opt_call_args : none
| args ',' assocs ','
{
/*%%%*/
$$ = $3 ? arg_append($1, new_hash($3, &@$), &@$) : $1;
$$ = $3 ? arg_append($1, new_hash($3, &@3), &@$) : $1;
/*%
$$ = arg_add_assocs($1, $3);
%*/
@ -2454,7 +2454,7 @@ opt_call_args : none
| assocs ','
{
/*%%%*/
$$ = $1 ? new_list(new_hash($1, &@$), &@$) : 0;
$$ = $1 ? new_list(new_hash($1, &@1), &@$) : 0;
/*%
$$ = arg_add_assocs(arg_new(), $1);
%*/
@ -2481,7 +2481,7 @@ call_args : command
| assocs opt_block_arg
{
/*%%%*/
$$ = $1 ? new_list(new_hash($1, &@$), &@$) : 0;
$$ = $1 ? new_list(new_hash($1, &@1), &@$) : 0;
$$ = arg_blk_pass($$, $2);
/*%
$$ = arg_add_assocs(arg_new(), $1);
@ -2491,7 +2491,7 @@ call_args : command
| args ',' assocs opt_block_arg
{
/*%%%*/
$$ = $3 ? arg_append($1, new_hash($3, &@$), &@$) : $1;
$$ = $3 ? arg_append($1, new_hash($3, &@3), &@$) : $1;
$$ = arg_blk_pass($$, $4);
/*%
$$ = arg_add_optblock(arg_add_assocs($1, $3), $4);