diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-25 13:44:18 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-25 13:44:18 +0000 |
commit | 27682eefa468b7bc2800fcf92d87e60cb62133a9 (patch) | |
tree | 36c7a921d51b7a75593bad75a9185e0c24dc6501 /parse.y | |
parent | 05ae2b730dba04585d4c775a61d395d62bc3f205 (diff) | |
download | ruby-27682eefa468b7bc2800fcf92d87e60cb62133a9.tar.gz |
compile.c: unnamed keyword rest check
* compile.c (iseq_set_arguments): set arg_keyword_check from
nd_cflag, which is set by parser. internal ID is used for
unnamed keyword rest argument, which should be separated from no
keyword check.
* iseq.c (rb_iseq_parameters): if no keyword check, keyword rest is
present.
* parse.y (new_args_tail_gen): set keywords check to nd_cflag, which
equals to that keyword rest is not present.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -9485,6 +9485,7 @@ new_args_tail_gen(struct parser_params *parser, NODE *k, ID kr, ID b) struct rb_args_info *args; NODE *kw_rest_arg = 0; NODE *node; + int check = 0; args = ALLOC(struct rb_args_info); MEMZERO(args, struct rb_args_info, 1); @@ -9492,10 +9493,14 @@ new_args_tail_gen(struct parser_params *parser, NODE *k, ID kr, ID b) args->block_arg = b; args->kw_args = k; - if (k && !kr) kr = internal_id(); + if (k && !kr) { + check = 1; + kr = internal_id(); + } if (kr) { arg_var(kr); kw_rest_arg = NEW_DVAR(kr); + kw_rest_arg->nd_cflag = check; } args->kw_rest_arg = kw_rest_arg; |