ruby-changes:39269
From: nobu <ko1@a...>
Date: Thu, 23 Jul 2015 09:05:50 +0900 (JST)
Subject: [ruby-changes:39269] nobu:r51350 (trunk): parse.y: pop cmdarg
nobu 2015-07-23 09:05:30 +0900 (Thu, 23 Jul 2015) New Revision: 51350 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51350 Log: parse.y: pop cmdarg * parse.y (lambda_body): pop cmdarg stack for lookahead token. [ruby-core:70067] [Bug #11380] Modified files: trunk/ChangeLog trunk/parse.y trunk/test/ruby/test_syntax.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 51349) +++ ChangeLog (revision 51350) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Jul 23 09:05:28 2015 Nobuyoshi Nakada <nobu@r...> + + * parse.y (lambda_body): pop cmdarg stack for lookahead + token. [ruby-core:70067] [Bug #11380] + Thu Jul 23 04:03:03 2015 Aaron Patterson <tenderlove@r...> * ext/openssl/ossl_ssl.c: fix tests by not setting the instance Index: parse.y =================================================================== --- parse.y (revision 51349) +++ parse.y (revision 51350) @@ -3524,6 +3524,7 @@ lambda : { https://github.com/ruby/ruby/blob/trunk/parse.y#L3524 { lpar_beg = $<num>2; cmdarg_stack = $<val>5; + CMDARG_LEXPOP(); /*%%%*/ $$ = NEW_LAMBDA($3, $6); nd_set_line($$, $<num>4); Index: test/ruby/test_syntax.rb =================================================================== --- test/ruby/test_syntax.rb (revision 51349) +++ test/ruby/test_syntax.rb (revision 51350) @@ -414,6 +414,11 @@ WARN https://github.com/ruby/ruby/blob/trunk/test/ruby/test_syntax.rb#L414 assert_valid_syntax('p ->() do a() do end end', bug11107) end + def test_do_block_after_lambda + bug11380 = '[ruby-core:70067] [Bug #11380]' + assert_valid_syntax('p -> { :hello }, a: 1 do end', bug11380) + end + def test_reserved_method_no_args bug6403 = '[ruby-dev:45626]' assert_valid_syntax("def self; :foo; end", __FILE__, bug6403) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/