summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2019-06-04 23:11:38 +0900
committerYusuke Endoh <mame@ruby-lang.org>2019-06-04 23:17:18 +0900
commit0872ea53303499caf3584e40f2a5438e86eb4fed (patch)
tree5f855704bd7f6a7d8cfa182fc19821ec7ab5cfa8 /compile.c
parent39eae6bf89773ef830b632c02737545ab9eedd35 (diff)
node.h: Avoid a magic number to represent excessed comma
`(ID)1` was assigned to NODE_ARGS#rest_arg for `{|x,| }`. This change removes the magic number by introducing an explicit macro variable for it: NODE_SPECIAL_EXCESSED_COMMA.
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 64bde0c962..e1a8885960 100644
--- a/compile.c
+++ b/compile.c
@@ -1632,7 +1632,7 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *const optargs, const NODE *cons
debugs(" - argc: %d\n", body->param.lead_num);
rest_id = args->rest_arg;
- if (rest_id == 1) {
+ if (rest_id == NODE_SPECIAL_EXCESSED_COMMA) {
last_comma = 1;
rest_id = 0;
}