Skip to content

Commit e996699

Browse files
committed
Refactor assignment rules to remove unnecessary lhs parameter
1 parent 3700ae2 commit e996699

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

parse.y

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2913,7 +2913,7 @@ rb_parser_ary_free(rb_parser_t *p, rb_parser_ary_t *ary)
29132913
/*
29142914
* parameterizing rules
29152915
*/
2916-
%rule asgn(lhs, rhs) <node>
2916+
%rule asgn(rhs) <node>
29172917
: lhs '=' lex_ctxt rhs
29182918
{
29192919
$$ = node_assign(p, (NODE *)$lhs, $rhs, $lex_ctxt, &@$);
@@ -3344,7 +3344,7 @@ stmt : keyword_alias fitem {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem
33443344
$$ = node_assign(p, (NODE *)$1, $4, $3, &@$);
33453345
/*% ripper: massign!($:1, $:4) %*/
33463346
}
3347-
| asgn(lhs, mrhs)
3347+
| asgn(mrhs)
33483348
| mlhs '=' lex_ctxt mrhs_arg modifier_rescue
33493349
after_rescue stmt[resbody]
33503350
{
@@ -3369,7 +3369,7 @@ stmt : keyword_alias fitem {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem
33693369
}
33703370
;
33713371

3372-
command_asgn : asgn(lhs, command_rhs)
3372+
command_asgn : asgn(command_rhs)
33733373
| op_asgn(command_rhs)
33743374
| def_endless_method(endless_command)
33753375
;
@@ -3872,7 +3872,7 @@ reswords : keyword__LINE__ | keyword__FILE__ | keyword__ENCODING__
38723872
| keyword_while | keyword_until
38733873
;
38743874

3875-
arg : asgn(lhs, arg_rhs)
3875+
arg : asgn(arg_rhs)
38763876
| op_asgn(arg_rhs)
38773877
| arg tDOT2 arg
38783878
{

0 commit comments

Comments
 (0)