mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
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:
parent
39eae6bf89
commit
0872ea5330
4 changed files with 12 additions and 8 deletions
1
node.h
1
node.h
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue