diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-11-25 07:30:32 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-11-25 07:30:32 +0900 |
| commit | e6b72b2121b981c504f902723b3c1531be001c02 (patch) | |
| tree | 4cbbbc7b3ddb30b5e7887ee41daa4e4b71aebb94 /mrbgems/mruby-compiler | |
| parent | 7ed9bb3bd361030c3fbeeaf72186e61c8e6563f0 (diff) | |
| download | mruby-e6b72b2121b981c504f902723b3c1531be001c02.tar.gz mruby-e6b72b2121b981c504f902723b3c1531be001c02.zip | |
Remove redundant rules from `parse.y`.
Diffstat (limited to 'mrbgems/mruby-compiler')
| -rw-r--r-- | mrbgems/mruby-compiler/core/parse.y | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y index 70b9d0fc4..1485fb086 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/mrbgems/mruby-compiler/core/parse.y @@ -1171,7 +1171,7 @@ heredoc_end(parser_state *p) %type <nd> command_args aref_args opt_block_arg block_arg var_ref var_lhs %type <nd> command_asgn command_rhs mrhs superclass block_call block_command %type <nd> f_block_optarg f_block_opt -%type <nd> f_arglist f_args f_arg f_arg_item f_optarg f_marg f_marg_list f_margs +%type <nd> f_arglist f_args f_arg f_arg_item f_optarg f_margs %type <nd> assoc_list assocs assoc undef_list backref for_var %type <nd> block_param opt_block_param block_param_def f_opt %type <nd> bv_decls opt_bv_decl bvar f_larglist lambda_body @@ -2447,44 +2447,24 @@ for_var : lhs | mlhs ; -f_marg : f_norm_arg - { - $$ = new_arg(p, $1); - } - | tLPAREN f_margs rparen - { - $$ = new_masgn(p, $2, 0); - } - ; - -f_marg_list : f_marg - { - $$ = list1($1); - } - | f_marg_list ',' f_marg - { - $$ = push($1, $3); - } - ; - -f_margs : f_marg_list +f_margs : f_arg { $$ = list3($1,0,0); } - | f_marg_list ',' tSTAR f_norm_arg + | f_arg ',' tSTAR f_norm_arg { $$ = list3($1, new_arg(p, $4), 0); } - | f_marg_list ',' tSTAR f_norm_arg ',' f_marg_list + | f_arg ',' tSTAR f_norm_arg ',' f_arg { $$ = list3($1, new_arg(p, $4), $6); } - | f_marg_list ',' tSTAR + | f_arg ',' tSTAR { local_add_f(p, 0); $$ = list3($1, (node*)-1, 0); } - | f_marg_list ',' tSTAR ',' f_marg_list + | f_arg ',' tSTAR ',' f_arg { $$ = list3($1, (node*)-1, $5); } @@ -2492,7 +2472,7 @@ f_margs : f_marg_list { $$ = list3(0, new_arg(p, $2), 0); } - | tSTAR f_norm_arg ',' f_marg_list + | tSTAR f_norm_arg ',' f_arg { $$ = list3(0, new_arg(p, $2), $4); } @@ -2505,7 +2485,7 @@ f_margs : f_marg_list { local_add_f(p, 0); } - f_marg_list + f_arg { $$ = list3(0, (node*)-1, $4); } |
