diff --git a/parse.y b/parse.y index 2ac575ca7f..0ddf12acce 100644 --- a/parse.y +++ b/parse.y @@ -6858,7 +6858,9 @@ assocs : assoc tail = RNODE_HASH(n)->nd_head; } } - assocs = list_concat(assocs, tail); + if (tail) { + assocs = list_concat(assocs, tail); + } } $$ = assocs; /*% %*/ @@ -6900,17 +6902,7 @@ assoc : arg_value tASSOC arg_value | tDSTAR arg_value { /*%%%*/ - if (nd_type_p($2, NODE_HASH) && - !(RNODE_HASH($2)->nd_head && RNODE_LIST(RNODE_HASH($2)->nd_head)->as.nd_alen)) { - static VALUE empty_hash; - if (!empty_hash) { - empty_hash = rb_obj_freeze(rb_hash_new()); - rb_gc_register_mark_object(empty_hash); - } - $$ = list_append(p, NEW_LIST(0, &@$), NEW_LIT(empty_hash, &@$)); - } - else - $$ = list_append(p, NEW_LIST(0, &@$), $2); + $$ = list_append(p, NEW_LIST(0, &@$), $2); /*% %*/ /*% ripper: assoc_splat!($2) %*/ }