diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-10 07:47:44 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-10 07:47:44 +0000 |
commit | 04a4fd8957f1e77ffaf6973b680c0697b85857a5 (patch) | |
tree | 10cee3ae9739a501ade8ac2457628e97937106cb /parse.y | |
parent | 25aeeca5b7dbe470c5ee04a3802de0cb7f14b9ad (diff) |
parse.y: new_attr_op_assign in ripper needs symbol
* parse.y (command_asgn, arg): new_attr_op_assign in ripper
expects a Symbol VALUE as the operator, not an ID, so convert
literal IDs to Symbols. [ruby-core:78069] [Bug #12916]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -741,6 +741,8 @@ static VALUE parser_heredoc_dedent(struct parser_params*,VALUE); #define FIXME 0 +#else +#define ripper_id2sym(id) id #endif /* RIPPER */ #ifndef RIPPER @@ -1366,7 +1368,7 @@ command_asgn : lhs '=' command_rhs | primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_rhs { value_expr($5); - $$ = new_attr_op_assign($1, idCOLON2, $3, $4, $5); + $$ = new_attr_op_assign($1, ripper_id2sym(idCOLON2), $3, $4, $5); } | backref tOP_ASGN command_rhs { @@ -2051,7 +2053,7 @@ arg : lhs '=' arg_rhs | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg_rhs { value_expr($5); - $$ = new_attr_op_assign($1, idCOLON2, $3, $4, $5); + $$ = new_attr_op_assign($1, ripper_id2sym(idCOLON2), $3, $4, $5); } | primary_value tCOLON2 tCONSTANT tOP_ASGN arg_rhs { |