diff options
author | yui-knk <[email protected]> | 2024-01-18 23:41:04 +0900 |
---|---|---|
committer | Yuichiro Kaneko <[email protected]> | 2024-01-22 16:05:43 +0900 |
commit | 3d19409637de1462b6790d2a92344bf0a10d8c52 (patch) | |
tree | 559d213c5f4f8d7feba5286cc019f23acbff5b5f | |
parent | 3736130dfaca096e3443180d89e46b48179dfa1e (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.y | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) %*/ } ; |