ruby-changes:48843
From: yui-knk <ko1@a...>
Date: Fri, 1 Dec 2017 18:48:22 +0900 (JST)
Subject: [ruby-changes:48843] yui-knk:r60960 (trunk): parse.y: Fix a location of NODE_HASH
yui-knk 2017-12-01 18:48:17 +0900 (Fri, 01 Dec 2017) New Revision: 60960 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60960 Log: 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) ``` Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 60959) +++ parse.y (revision 60960) @@ -2389,7 +2389,7 @@ aref_args : none https://github.com/ruby/ruby/blob/trunk/parse.y#L2389 | 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 https://github.com/ruby/ruby/blob/trunk/parse.y#L2397 | 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 https://github.com/ruby/ruby/blob/trunk/parse.y#L2446 | 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 https://github.com/ruby/ruby/blob/trunk/parse.y#L2454 | 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 https://github.com/ruby/ruby/blob/trunk/parse.y#L2481 | 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 https://github.com/ruby/ruby/blob/trunk/parse.y#L2491 | 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/