ruby-changes:45764
From: naruse <ko1@a...>
Date: Sat, 11 Mar 2017 21:53:49 +0900 (JST)
Subject: [ruby-changes:45764] naruse:r57837 (ruby_2_4): merge revision(s) 57198: [Backport #13073]
naruse 2017-03-11 21:53:45 +0900 (Sat, 11 Mar 2017) New Revision: 57837 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57837 Log: merge revision(s) 57198: [Backport #13073] parse.y: preserve cmdarg stack * parse.y (do_body): preserve cmdarg stack around do/end block. [ruby-core:78837] [Bug #13073] Modified directories: branches/ruby_2_4/ Modified files: branches/ruby_2_4/parse.y branches/ruby_2_4/test/ruby/test_syntax.rb branches/ruby_2_4/version.h Index: ruby_2_4/version.h =================================================================== --- ruby_2_4/version.h (revision 57836) +++ ruby_2_4/version.h (revision 57837) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #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 Index: ruby_2_4/test/ruby/test_syntax.rb =================================================================== --- ruby_2_4/test/ruby/test_syntax.rb (revision 57836) +++ ruby_2_4/test/ruby/test_syntax.rb (revision 57837) @@ -917,6 +917,15 @@ eom https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/ruby/test_syntax.rb#L917 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 Index: ruby_2_4/parse.y =================================================================== --- ruby_2_4/parse.y (revision 57836) +++ ruby_2_4/parse.y (revision 57837) @@ -3762,7 +3762,7 @@ brace_body : {$<vars>$ = dyna_push();} https://github.com/ruby/ruby/blob/trunk/ruby_2_4/parse.y#L3762 ; do_body : {$<vars>$ = dyna_push();} - {$<val>$ = cmdarg_stack >> 1; CMDARG_SET(0);} + {$<val>$ = cmdarg_stack; CMDARG_SET(0);} opt_block_param compstmt { $$ = new_do_body($3, $4); Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r57198 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/