aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-10 08:26:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-10 08:26:46 +0000
commit53d6cda30ce300670e34fc076e84afbed64f266b (patch)
treedd9965e0b388eccaa5873c988462c8fac3a09033 /parse.y
parenta550ff57cae8d8ba423325593915b238cc941c18 (diff)
downloadruby-53d6cda30ce300670e34fc076e84afbed64f266b.tar.gz
parse.y: rescue modifier in rhs
* parse.y (command_asgn): rescue modifier in command assignment should be limited to rhs only. [ruby-core:75621] [Bug #12402] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y12
1 files changed, 12 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index ac7ad146ad..94518ab780 100644
--- a/parse.y
+++ b/parse.y
@@ -1357,6 +1357,18 @@ command_asgn : lhs '=' command_call
$$ = dispatch2(assign, $1, $3);
%*/
}
+ | lhs '=' command_call modifier_rescue stmt
+ {
+ /*%%%*/
+ NODE *resq = NEW_RESBODY(0, remove_begin($5), 0);
+ value_expr($3);
+ resq = NEW_RESCUE($3, resq, 0);
+ $$ = node_assign($1, resq);
+ /*%
+ $3 = dispatch2(rescue_mod, $3, $5);
+ $$ = dispatch2(assign, $1, $3);
+ %*/
+ }
| lhs '=' command_asgn
{
/*%%%*/