From 04a4fd8957f1e77ffaf6973b680c0697b85857a5 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 10 Nov 2016 07:47:44 +0000 Subject: 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 --- parse.y | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 54ccc52cc6..f9acacc0fb 100644 --- a/parse.y +++ b/parse.y @@ -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 { -- cgit v1.2.3