diff --git a/parse.y b/parse.y index 85cbc37331..8a800bbd50 100644 --- a/parse.y +++ b/parse.y @@ -3762,7 +3762,7 @@ brace_body : {$$ = dyna_push();} ; do_body : {$$ = dyna_push();} - {$$ = cmdarg_stack >> 1; CMDARG_SET(0);} + {$$ = cmdarg_stack; CMDARG_SET(0);} opt_block_param compstmt { $$ = new_do_body($3, $4); diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 3e6212e27c..f40f15316b 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -917,6 +917,15 @@ eom end end + def test_do_block_in_hash_brace + bug13073 = '[ruby-core:78837] [Bug #13073]' + assert_valid_syntax 'p :foo, {a: proc do end, b: proc do end}', bug13073 + assert_valid_syntax 'p :foo, {:a => proc do end, b: proc do end}', bug13073 + assert_valid_syntax 'p :foo, {"a": proc do end, b: proc do end}', bug13073 + assert_valid_syntax 'p :foo, {** proc do end, b: proc do end}', bug13073 + assert_valid_syntax 'p :foo, {proc do end => proc do end, b: proc do end}', bug13073 + end + def test_do_after_local_variable obj = Object.new def obj.m; yield; end diff --git a/version.h b/version.h index 2e2d074a4e..afefdc7510 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.4.0" #define RUBY_RELEASE_DATE "2017-03-11" -#define RUBY_PATCHLEVEL 5 +#define RUBY_PATCHLEVEL 6 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 3