diff --git a/parse.y b/parse.y index b917a3d2f4..1348842b91 100644 --- a/parse.y +++ b/parse.y @@ -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); %*/ @@ -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); /*% %*/ } diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 6d8d8f5f32..7e25d965df 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -179,6 +179,11 @@ class TestSyntax < Test::Unit::TestCase 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 diff --git a/version.h b/version.h index d89fc2804a..8e0f2a198e 100644 --- a/version.h +++ b/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