summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-11 01:27:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-11 01:27:24 +0000
commit03a2862b983c7dd6c1b9fd016154191213750ed3 (patch)
tree7998cf9313f4c5e462b6933f5067f13d6974ce50 /compile.c
parent28c02b9e087bfa09c04b38da9c6790a04c4f93d2 (diff)
separate hash literal and keyword arguments
* compile.c (compile_array_keyword_arg): separate keyword splat inside hash literal from argument list. * parse.y (rparen): flag hash literal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 99e00b4e6a..170bb99776 100644
--- a/compile.c
+++ b/compile.c
@@ -3053,7 +3053,7 @@ compile_array_keyword_arg(rb_iseq_t *iseq, LINK_ANCHOR *const ret,
assert(nd_type(node) == NODE_ARRAY);
if (!key_node) {
- if (flag) *flag |= VM_CALL_KW_SPLAT;
+ if (flag && !root_node->nd_alen) *flag |= VM_CALL_KW_SPLAT;
return FALSE;
}
else if (nd_type(key_node) == NODE_LIT && RB_TYPE_P(key_node->nd_lit, T_SYMBOL)) {