ruby-changes:40034
From: nobu <ko1@a...>
Date: Mon, 12 Oct 2015 12:26:29 +0900 (JST)
Subject: [ruby-changes:40034] nobu:r52115 (trunk): parse.y: move ripper_id2sym
nobu 2015-10-12 12:26:24 +0900 (Mon, 12 Oct 2015) New Revision: 52115 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52115 Log: parse.y: move ripper_id2sym * parse.y (new_attr_op_assign): move ripper_id2sym from each rules. Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 52114) +++ parse.y (revision 52115) @@ -518,7 +518,7 @@ static int id_is_var_gen(struct parser_p https://github.com/ruby/ruby/blob/trunk/parse.y#L518 static VALUE new_op_assign_gen(struct parser_params *parser, VALUE lhs, VALUE op, VALUE rhs); static VALUE new_attr_op_assign_gen(struct parser_params *parser, VALUE lhs, VALUE type, VALUE attr, VALUE op, VALUE rhs); -#define new_attr_op_assign(lhs, type, attr, op, rhs) new_attr_op_assign_gen(parser, (lhs), (type), (attr), (op), (rhs)) +#define new_attr_op_assign(lhs, type, attr, op, rhs) new_attr_op_assign_gen(parser, (lhs), ripper_id2sym(type), (attr), (op), (rhs)) #endif /* !RIPPER */ @@ -1253,12 +1253,12 @@ stmt : keyword_alias fitem {lex_state = https://github.com/ruby/ruby/blob/trunk/parse.y#L1253 | primary_value '.' tIDENTIFIER tOP_ASGN command_call { value_expr($5); - $$ = new_attr_op_assign($1, ripper_id2sym('.'), $3, $4, $5); + $$ = new_attr_op_assign($1, '.', $3, $4, $5); } | primary_value '.' tCONSTANT tOP_ASGN command_call { value_expr($5); - $$ = new_attr_op_assign($1, ripper_id2sym('.'), $3, $4, $5); + $$ = new_attr_op_assign($1, '.', $3, $4, $5); } | primary_value tCOLON2 tCONSTANT tOP_ASGN command_call { @@ -1273,7 +1273,7 @@ stmt : keyword_alias fitem {lex_state = https://github.com/ruby/ruby/blob/trunk/parse.y#L1273 | primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_call { value_expr($5); - $$ = new_attr_op_assign($1, ID2SYM(idCOLON2), $3, $4, $5); + $$ = new_attr_op_assign($1, idCOLON2, $3, $4, $5); } | backref tOP_ASGN command_call { @@ -2057,17 +2057,17 @@ arg : lhs '=' arg https://github.com/ruby/ruby/blob/trunk/parse.y#L2057 | primary_value '.' tIDENTIFIER tOP_ASGN arg { value_expr($5); - $$ = new_attr_op_assign($1, ripper_id2sym('.'), $3, $4, $5); + $$ = new_attr_op_assign($1, '.', $3, $4, $5); } | primary_value '.' tCONSTANT tOP_ASGN arg { value_expr($5); - $$ = new_attr_op_assign($1, ripper_id2sym('.'), $3, $4, $5); + $$ = new_attr_op_assign($1, '.', $3, $4, $5); } | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg { value_expr($5); - $$ = new_attr_op_assign($1, ID2SYM(idCOLON2), $3, $4, $5); + $$ = new_attr_op_assign($1, idCOLON2, $3, $4, $5); } | primary_value tCOLON2 tCONSTANT tOP_ASGN arg { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/