summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-22 13:13:24 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-22 13:13:24 +0000
commitbe2101a641bcb320521ebcd498c147b81ea96b19 (patch)
treeca883487694bce8f16d587801a1514235e408a4e /parse.y
parent3aa457ce139a2698a7c1c22e7d928f1325830cf9 (diff)
merge revision(s) 44412,44413,44414,44420,44421: [Backport #9298]
test_method.rb, test_proc.rb: suppress warnings * test/ruby/test_method.rb: suppress warnings in verbose mode. * test/ruby/test_proc.rb: ditto. * proc.c (rb_iseq_min_max_arity): maximum argument is unlimited if having rest keywords argument. [ruby-core:53298] [Bug #8072] * iseq.c (rb_iseq_parameters): push argument type symbol only for unnamed rest keywords argument. * 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/branches/ruby_2_1@45138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y7
1 files changed, 6 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index eb5ed547d3..25946dccda 100644
--- a/parse.y
+++ b/parse.y
@@ -9486,6 +9486,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);
@@ -9493,10 +9494,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;