summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryui-knk <[email protected]>2024-01-18 23:41:04 +0900
committerYuichiro Kaneko <[email protected]>2024-01-22 16:05:43 +0900
commit3d19409637de1462b6790d2a92344bf0a10d8c52 (patch)
tree559d213c5f4f8d7feba5286cc019f23acbff5b5f
parent3736130dfaca096e3443180d89e46b48179dfa1e (diff)
Use index for referring to symbols in `args` rule instead of named references
In `args: args ',' arg_splat`, `args` is not unique name. Currently the associated rule is interpreted as `$$ = rest_arg_append(p, $$, $3, &@$);`. The action works as expected because `$$` is initialized with `$1` before each action is executed. However it's misleading then change to use index.
-rw-r--r--parse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 7cb92b88e3..66f8545e6d 100644
--- a/parse.y
+++ b/parse.y
@@ -4043,9 +4043,9 @@ args : arg_value
| args ',' arg_splat
{
/*%%%*/
- $$ = rest_arg_append(p, $args, $arg_splat, &@$);
+ $$ = rest_arg_append(p, $1, $3, &@$);
/*% %*/
- /*% ripper: args_add_star!($args, $arg_splat) %*/
+ /*% ripper: args_add_star!($1, $3) %*/
}
;