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.
This commit is contained in:
Yusuke Endoh 2019-06-04 23:11:38 +09:00
parent 39eae6bf89
commit 0872ea5330
4 changed files with 12 additions and 8 deletions

1
node.h
View file

@ -383,6 +383,7 @@ typedef struct RNode {
#define NODE_REQUIRED_KEYWORD_P(node) ((node)->nd_value == NODE_SPECIAL_REQUIRED_KEYWORD)
#define NODE_SPECIAL_NO_NAME_REST ((NODE *)-1)
#define NODE_NAMED_REST_P(node) ((node) != NODE_SPECIAL_NO_NAME_REST)
#define NODE_SPECIAL_EXCESSED_COMMA ((ID)1)
VALUE rb_node_case_when_optimizable_literal(const NODE *const node);