diff options
author | yui-knk <[email protected]> | 2023-12-28 12:38:24 +0900 |
---|---|---|
committer | Yuichiro Kaneko <[email protected]> | 2023-12-29 18:32:27 +0900 |
commit | 1ade170a6cac402d362d90bbf12e566d6a4f9ba1 (patch) | |
tree | 7bb01bb33a31122ecc7733f81842323022c3265a /rubyparser.h | |
parent | 6f33e3c53dd97426b91b97b7239a1b9a3dd6a446 (diff) |
Introduce NODE_LINE
`__LINE__` was managed by `NODE_LIT` with `Integer` object.
This commit introduces `NODE_LINE` so that
1. `__LINE__` is detectable from AST Node
2. Reduce dependency ruby object
Diffstat (limited to 'rubyparser.h')
-rw-r--r-- | rubyparser.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/rubyparser.h b/rubyparser.h index e6a0a6bc8d..f61fe4603c 100644 --- a/rubyparser.h +++ b/rubyparser.h @@ -130,6 +130,7 @@ enum node_type { NODE_HSHPTN, NODE_FNDPTN, NODE_ERROR, + NODE_LINE, NODE_RIPPER, NODE_RIPPER_VALUES, NODE_LAST @@ -931,6 +932,10 @@ typedef struct RNode_FNDPTN { NODE *post_rest_arg; } rb_node_fndptn_t; +typedef struct RNode_LINE { + NODE node; +} rb_node_line_t; + typedef struct RNode_ERROR { NODE node; } rb_node_error_t; @@ -1040,6 +1045,7 @@ typedef struct RNode_ERROR { #define RNODE_ARYPTN(node) ((struct RNode_ARYPTN *)(node)) #define RNODE_HSHPTN(node) ((struct RNode_HSHPTN *)(node)) #define RNODE_FNDPTN(node) ((struct RNode_FNDPTN *)(node)) +#define RNODE_LINE(node) ((struct RNode_LINE *)(node)) #ifdef RIPPER typedef struct RNode_RIPPER { |