diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2019-06-04 23:11:38 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2019-06-04 23:17:18 +0900 |
commit | 0872ea53303499caf3584e40f2a5438e86eb4fed (patch) | |
tree | 5f855704bd7f6a7d8cfa182fc19821ec7ab5cfa8 /node.h | |
parent | 39eae6bf89773ef830b632c02737545ab9eedd35 (diff) | |
download | ruby-0872ea53303499caf3584e40f2a5438e86eb4fed.tar.gz |
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 'node.h')
-rw-r--r-- | node.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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); |