1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* node.h, node.c, parse.y: implement a parser part for keyword arguments. This is a preparation for keyword argument (see [ruby-core:40290]).

* gc.c (gc_mark_children): bookkeeping.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2011-12-26 14:20:03 +00:00
parent afb10c62c2
commit 1ab3974b0e
5 changed files with 650 additions and 75 deletions

11
node.c
View file

@ -823,6 +823,15 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_next, "next");
break;
case NODE_KW_ARG:
ANN("keyword arguments");
ANN("format: def method_name([nd_body=some], [nd_next..])");
ANN("example: def foo(a:1, b:2); end");
F_NODE(nd_body, "body");
LAST_NODE;
F_NODE(nd_next, "next");
break;
case NODE_POSTARG:
ANN("post arguments");
ANN("format: *[nd_1st], [nd_2nd..] = ..");
@ -849,6 +858,8 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_ID(nd_ainfo->rest_arg, "rest argument");
F_ID(nd_ainfo->block_arg, "block argument");
F_NODE(nd_ainfo->opt_args, "optional arguments");
LAST_NODE;
F_NODE(nd_ainfo->kw_args, "keyword arguments");
break;
case NODE_SCOPE: