Skip to content

Commit

Permalink
merge revision(s) 65460: [Backport #15271]
Browse files Browse the repository at this point in the history
	parse.y: last location from bison

	* parse.y (command): set the last location from the location
	  managed by bison, so that other nodes are not needed.
	  [ruby-core:89648] [Bug #15271]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@65581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nagachika committed Nov 6, 2018
1 parent 7560091 commit 218ac97
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions parse.y
Expand Up @@ -1673,7 +1673,7 @@ command : fcall command_args %prec tLOWEST
/*%%%*/
$$ = $1;
$$->nd_args = $2;
nd_set_last_loc($1, nd_last_loc($2));
nd_set_last_loc($1, @2.last_loc);
/*%
$$ = dispatch2(command, $1, $2);
%*/
Expand All @@ -1686,7 +1686,7 @@ command : fcall command_args %prec tLOWEST
fixpos($$, $1);
/*%%%*/
$$->nd_loc = @$;
nd_set_last_loc($1, nd_last_loc($2));
nd_set_last_loc($1, @2.last_loc);
/*%
%*/
}
Expand Down
5 changes: 5 additions & 0 deletions test/ruby/test_syntax.rb
Expand Up @@ -179,6 +179,11 @@ def test_keyword_empty_splat
bug13756 = '[ruby-core:82113] [Bug #13756]'
assert_valid_syntax("defined? foo(**{})", bug13756)
end;
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
begin;
bug15271 = '[ruby-core:89648] [Bug #15271]'
assert_valid_syntax("a **{}", bug15271)
end;
end

def test_keyword_self_reference
Expand Down
2 changes: 1 addition & 1 deletion version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.5.4"
#define RUBY_RELEASE_DATE "2018-11-07"
#define RUBY_PATCHLEVEL 109
#define RUBY_PATCHLEVEL 110

#define RUBY_RELEASE_YEAR 2018
#define RUBY_RELEASE_MONTH 11
Expand Down

0 comments on commit 218ac97

Please sign in to comment.