Skip to content
Permalink
Browse files
parse.y: fix chained assignments
fix syntax errors with chained assignment with op assign.
reported [Bug:12669] in bugs.ruby-lang.org fixed in CRuby 2.4.
  • Loading branch information
nobu committed Aug 13, 2016
1 parent bee34fb commit bdd7e2bc8caf737143c18270abf7325c3540b7b6
Showing 1 changed file with 19 additions and 19 deletions.
@@ -1318,6 +1318,25 @@ stmt : keyword_alias fsym {p->lstate = EXPR_FNAME;} fsym
{
$$ = new_masgn(p, $1, $3);
}
| lhs '=' mrhs
{
$$ = new_asgn(p, $1, new_array(p, $3));
}
| mlhs '=' arg_value
{
$$ = new_masgn(p, $1, $3);
}
| mlhs '=' mrhs
{
$$ = new_masgn(p, $1, new_array(p, $3));
}
| expr
;

command_asgn : lhs '=' command_rhs
{
$$ = new_asgn(p, $1, $3);
}
| var_lhs tOP_ASGN command_rhs
{
$$ = new_op_asgn(p, $1, $2, $3);
@@ -1348,25 +1367,6 @@ stmt : keyword_alias fsym {p->lstate = EXPR_FNAME;} fsym
backref_error(p, $1);
$$ = new_begin(p, 0);
}
| lhs '=' mrhs
{
$$ = new_asgn(p, $1, new_array(p, $3));
}
| mlhs '=' arg_value
{
$$ = new_masgn(p, $1, $3);
}
| mlhs '=' mrhs
{
$$ = new_masgn(p, $1, new_array(p, $3));
}
| expr
;

command_asgn : lhs '=' command_rhs
{
$$ = new_asgn(p, $1, $3);
}
;

command_rhs : command_call %prec tOP_ASGN

0 comments on commit bdd7e2b

Please sign in to comment.