aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-23 00:05:30 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-23 00:05:30 +0000
commit730e84b12a742850753913a19f63b3cc818ab4b3 (patch)
treeebaa6503d450bcc3653dcfddd608f4a3e852ebab
parenta74c407fc2ccc5036740f35b71c50478a5fae66e (diff)
downloadruby-730e84b12a742850753913a19f63b3cc818ab4b3.tar.gz
parse.y: pop cmdarg
* parse.y (lambda_body): pop cmdarg stack for lookahead token. [ruby-core:70067] [Bug #11380] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--parse.y1
-rw-r--r--test/ruby/test_syntax.rb5
3 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 9841627692..3500817f98 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jul 23 09:05:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@ruby-lang.org>
* ext/openssl/ossl_ssl.c: fix tests by not setting the instance
diff --git a/parse.y b/parse.y
index 7f693fe92e..fe62426dcf 100644
--- a/parse.y
+++ b/parse.y
@@ -3524,6 +3524,7 @@ lambda : {
{
lpar_beg = $<num>2;
cmdarg_stack = $<val>5;
+ CMDARG_LEXPOP();
/*%%%*/
$$ = NEW_LAMBDA($3, $6);
nd_set_line($$, $<num>4);
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 189cf1358d..158c12d9b6 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -414,6 +414,11 @@ WARN
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)