From 1ab3974b0efea5155da005ec08a1feee90023d98 Mon Sep 17 00:00:00 2001 From: mame Date: Mon, 26 Dec 2011 14:20:03 +0000 Subject: * 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 --- node.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'node.c') diff --git a/node.c b/node.c index eca8981bfc..cfeb562952 100644 --- a/node.c +++ b/node.c @@ -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: -- cgit v1.2.3