mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
parse.y: allow anonymous rest (and keyword rest) arguments.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user