parse.y: allow anonymous rest (and keyword rest) arguments.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-06-01 22:36:56 +09:00
parent 6649b353c9
commit 5cbce646b0
+8
View File
@@ -2627,6 +2627,10 @@ args : arg
$$ = list1($1);
NODE_LINENO($$, $1);
}
| tSTAR
{
$$ = list1(new_splat(p, new_lvar(p, intern_op(mul))));
}
| tSTAR arg
{
$$ = list1(new_splat(p, $2));
@@ -4047,6 +4051,10 @@ assoc : arg tASSOC arg
void_expr_error(p, $2);
$$ = cons(new_kw_rest_args(p, 0), $2);
}
| tDSTAR
{
$$ = cons(new_kw_rest_args(p, 0), new_lvar(p, intern_op(pow)));
}
;
operation : tIDENTIFIER