summaryrefslogtreecommitdiff
path: root/node.h
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-26 14:19:58 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-26 14:19:58 +0000
commitafb10c62c2e45801df4245e6131af3a98efdebd1 (patch)
tree6fa9986e29f1f972819d260bb2376e732a467868 /node.h
parent90b1afa3104659898aad5978b164d48e1809e228 (diff)
* node.h, parse.y (new_args_gen), compile.c (iseq_set_arguments): use struct rb_args_info instead of NODEs. This is a preparation for keyword argument (see [ruby-core:40290]).
* node.c (dump_node), gc.c (gc_mark_children, obj_free): bookkeeping. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'node.h')
-rw-r--r--node.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/node.h b/node.h
index 7c360cd..873c52c 100644
--- a/node.h
+++ b/node.h
@@ -253,6 +253,7 @@ typedef struct RNode {
ID id;
long state;
struct rb_global_entry *entry;
+ struct rb_args_info *args;
long cnt;
VALUE value;
} u3;
@@ -321,6 +322,7 @@ typedef struct RNode {
#define nd_recv u1.node
#define nd_mid u2.id
#define nd_args u3.node
+#define nd_ainfo u3.args
#define nd_noex u3.id
#define nd_defn u3.node
@@ -415,7 +417,6 @@ typedef struct RNode {
#define NEW_VCALL(m) NEW_NODE(NODE_VCALL,0,m,0)
#define NEW_SUPER(a) NEW_NODE(NODE_SUPER,0,0,a)
#define NEW_ZSUPER() NEW_NODE(NODE_ZSUPER,0,0,0)
-#define NEW_ARGS(m,o) NEW_NODE(NODE_ARGS,o,m,0)
#define NEW_ARGS_AUX(r,b) NEW_NODE(NODE_ARGS_AUX,r,b,0)
#define NEW_OPT_ARG(i,v) NEW_NODE(NODE_OPT_ARG,i,v,0)
#define NEW_POSTARG(i,v) NEW_NODE(NODE_POSTARG,i,v,0)
@@ -483,6 +484,20 @@ VALUE rb_gvar_set(struct rb_global_entry *, VALUE);
VALUE rb_gvar_defined(struct rb_global_entry *);
const struct kwtable *rb_reserved_word(const char *, unsigned int);
+struct rb_args_info {
+ long pre_args_num; /* count of mandatory pre-arguments */
+ NODE *pre_init;
+
+ long post_args_num; /* count of mandatory post-arguments */
+ NODE *post_init;
+ ID first_post_arg;
+
+ ID rest_arg;
+ ID block_arg;
+
+ NODE *opt_args;
+};
+
struct parser_params;
void *rb_parser_malloc(struct parser_params *, size_t);
void *rb_parser_realloc(struct parser_params *, void *, size_t);