aboutsummaryrefslogtreecommitdiffstats
path: root/node.h
diff options
context:
space:
mode:
authorKazuki Tsujimoto <kazuki@callcc.net>2020-06-14 09:24:36 +0900
committerKazuki Tsujimoto <kazuki@callcc.net>2020-06-14 09:24:36 +0900
commitddded1157a90d21cb54b9f07de35ab9b4cc472e1 (patch)
tree315005f4eead6840846e6ce4bbd4dfa44c3bfce7 /node.h
parentf7906a7e31e6b1cfa135ecea69deb8827e8c8803 (diff)
downloadruby-ddded1157a90d21cb54b9f07de35ab9b4cc472e1.tar.gz
Introduce find pattern [Feature #16828]
Diffstat (limited to 'node.h')
-rw-r--r--node.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/node.h b/node.h
index 805491b87e..60e9604f46 100644
--- a/node.h
+++ b/node.h
@@ -123,6 +123,7 @@ enum node_type {
NODE_LAMBDA,
NODE_ARYPTN,
NODE_HSHPTN,
+ NODE_FNDPTN,
NODE_LAST
};
@@ -166,6 +167,7 @@ typedef struct RNode {
struct rb_global_entry *entry;
struct rb_args_info *args;
struct rb_ary_pattern_info *apinfo;
+ struct rb_fnd_pattern_info *fpinfo;
VALUE value;
} u3;
rb_code_location_t nd_loc;
@@ -278,6 +280,8 @@ typedef struct RNode {
#define nd_apinfo u3.apinfo
+#define nd_fpinfo u3.fpinfo
+
#define NEW_NODE(t,a0,a1,a2,loc) rb_node_newnode((t),(VALUE)(a0),(VALUE)(a1),(VALUE)(a2),loc)
#define NEW_NODE_WITH_LOCALS(t,a1,a2,loc) node_newnode_with_locals(p, (t),(VALUE)(a1),(VALUE)(a2),loc)
@@ -456,6 +460,13 @@ struct rb_ary_pattern_info {
VALUE imemo;
};
+struct rb_fnd_pattern_info {
+ NODE *pre_rest_arg;
+ NODE *args;
+ NODE *post_rest_arg;
+ VALUE imemo;
+};
+
struct parser_params;
void *rb_parser_malloc(struct parser_params *, size_t);
void *rb_parser_realloc(struct parser_params *, void *, size_t);