diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-26 14:20:03 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-26 14:20:03 +0000 |
commit | 1ab3974b0efea5155da005ec08a1feee90023d98 (patch) | |
tree | d1c1dd482b08f39c7b4b752b15c8e6952fdd89d8 /node.c | |
parent | afb10c62c2e45801df4245e6131af3a98efdebd1 (diff) | |
download | ruby-1ab3974b0efea5155da005ec08a1feee90023d98.tar.gz |
* 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
Diffstat (limited to 'node.c')
-rw-r--r-- | node.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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: |