aboutsummaryrefslogtreecommitdiffstats
path: root/node.c
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.c
parent90b1afa3104659898aad5978b164d48e1809e228 (diff)
downloadruby-afb10c62c2e45801df4245e6131af3a98efdebd1.tar.gz
* 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.c')
-rw-r--r--node.c53
1 files changed, 8 insertions, 45 deletions
diff --git a/node.c b/node.c
index 5912bc4752..eca8981bfc 100644
--- a/node.c
+++ b/node.c
@@ -837,55 +837,18 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_2nd, "post arguments");
break;
- case NODE_ARGS_AUX:
- ANN("method parameters (cont'd)");
- F_CUSTOM1(nd_rest, "rest argument", {
- if (node->nd_rest == 1) A("nil (with last comma)");
- else A_ID(node->nd_rest);
- });
- F_CUSTOM1(nd_body, "block argument", { A_ID((ID)node->nd_body); });
- LAST_NODE;
- F_CUSTOM2(nd_next, "aux info 2", {
- node = node->nd_next;
- next_indent = "| ";
- if (!node) {
- D_NULL_NODE;
- }
- else {
- D_NODE_HEADER(node);
- ANN("method parameters (cont'd)");
- F_ID(nd_pid, "first post argument");
- F_LONG(nd_plen, "post argument length");
- LAST_NODE;
- F_CUSTOM2(nd_next, "aux info 3", {
- node = node->nd_next;
- next_indent = "| ";
- if (!node) {
- D_NULL_NODE;
- }
- else {
- D_NODE_HEADER(node);
- ANN("method parameters (cont'd)");
- ANN("\"init arguments (m)\" evaluates multiple assignments before rest argument");
- ANN("\"init arguments (p)\" evaluates multiple assignments after rest argument");
- ANN("example: def foo((m1, m2), *r, (p1, p2))");
- F_NODE(nd_1st, "init arguments (m)");
- LAST_NODE;
- F_NODE(nd_2nd, "init arguments (p)");
- }
- });
- }
- });
- break;
-
case NODE_ARGS:
ANN("method parameters");
ANN("format: def method_name(.., [nd_opt=some], *[nd_rest], [nd_pid], .., &[nd_body])");
ANN("example: def foo(a, b, opt1=1, opt2=2, *rest, y, z, &blk); end");
- F_LONG(nd_frml, "argc");
- F_NODE(nd_next, "aux info 1");
- LAST_NODE;
- F_NODE(nd_opt, "optional arguments");
+ F_LONG(nd_ainfo->pre_args_num, "count of mandatory (pre-)arguments");
+ F_NODE(nd_ainfo->pre_init, "initialization of (pre-)arguments");
+ F_LONG(nd_ainfo->post_args_num, "count of mandatory post-arguments");
+ F_NODE(nd_ainfo->post_init, "initialization of post-arguments");
+ F_ID(nd_ainfo->first_post_arg, "first post argument");
+ F_ID(nd_ainfo->rest_arg, "rest argument");
+ F_ID(nd_ainfo->block_arg, "block argument");
+ F_NODE(nd_ainfo->opt_args, "optional arguments");
break;
case NODE_SCOPE: