From 5cbce646b060dcaa2aa2fdf252979f8d821ebe73 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 1 Jun 2022 22:36:56 +0900 Subject: [PATCH] parse.y: allow anonymous rest (and keyword rest) arguments. --- mrbgems/mruby-compiler/core/parse.y | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y index 12d57445e..831b45d02 100644 --- a/mrbgems/mruby-compiler/core/parse.y +++ b/mrbgems/mruby-compiler/core/parse.y @@ -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