Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions imemo.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,14 @@ rb_imemo_fields_clone(VALUE fields_obj)
VALUE clone;

if (rb_shape_too_complex_p(shape_id)) {
clone = rb_imemo_fields_new_complex(rb_imemo_fields_owner(fields_obj), 0);
RBASIC_SET_SHAPE_ID(clone, shape_id);
st_table *src_table = rb_imemo_fields_complex_tbl(fields_obj);
st_table *dest_table = rb_imemo_fields_complex_tbl(clone);

st_table *dest_table = xcalloc(1, sizeof(st_table));
clone = rb_imemo_fields_new_complex_tbl(rb_imemo_fields_owner(fields_obj), dest_table);

st_replace(dest_table, src_table);
RBASIC_SET_SHAPE_ID(clone, shape_id);

st_foreach(dest_table, imemo_fields_complex_wb_i, (st_data_t)clone);
}
else {
Expand Down
20 changes: 10 additions & 10 deletions parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -3026,13 +3026,13 @@ rb_parser_ary_free(rb_parser_t *p, rb_parser_ary_t *ary)
}
;

%rule mlhs(item) <node>
%rule mlhs_items(item) <node>
: item
{
$$ = NEW_LIST($1, &@$);
/*% ripper: mlhs_add!(mlhs_new!, $:1) %*/
}
| mlhs(item) ',' item
| mlhs_items(item) ',' item
{
$$ = list_append(p, $1, $3);
/*% ripper: mlhs_add!($:1, $:3) %*/
Expand Down Expand Up @@ -3676,7 +3676,7 @@ mlhs_basic : mlhs_head
$$ = NEW_MASGN($1, $3, &@$);
/*% ripper: mlhs_add_star!($:1, $:3) %*/
}
| mlhs_head tSTAR mlhs_node ',' mlhs(mlhs_item)
| mlhs_head tSTAR mlhs_node ',' mlhs_items(mlhs_item)
{
$$ = NEW_MASGN($1, NEW_POSTARG($3,$5,&@$), &@$);
/*% ripper: mlhs_add_post!(mlhs_add_star!($:1, $:3), $:5) %*/
Expand All @@ -3686,7 +3686,7 @@ mlhs_basic : mlhs_head
$$ = NEW_MASGN($1, NODE_SPECIAL_NO_NAME_REST, &@$);
/*% ripper: mlhs_add_star!($:1, Qnil) %*/
}
| mlhs_head tSTAR ',' mlhs(mlhs_item)
| mlhs_head tSTAR ',' mlhs_items(mlhs_item)
{
$$ = NEW_MASGN($1, NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, $4, &@$), &@$);
/*% ripper: mlhs_add_post!(mlhs_add_star!($:1, Qnil), $:4) %*/
Expand All @@ -3696,7 +3696,7 @@ mlhs_basic : mlhs_head
$$ = NEW_MASGN(0, $2, &@$);
/*% ripper: mlhs_add_star!(mlhs_new!, $:2) %*/
}
| tSTAR mlhs_node ',' mlhs(mlhs_item)
| tSTAR mlhs_node ',' mlhs_items(mlhs_item)
{
$$ = NEW_MASGN(0, NEW_POSTARG($2,$4,&@$), &@$);
/*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $:2), $:4) %*/
Expand All @@ -3706,7 +3706,7 @@ mlhs_basic : mlhs_head
$$ = NEW_MASGN(0, NODE_SPECIAL_NO_NAME_REST, &@$);
/*% ripper: mlhs_add_star!(mlhs_new!, Qnil) %*/
}
| tSTAR ',' mlhs(mlhs_item)
| tSTAR ',' mlhs_items(mlhs_item)
{
$$ = NEW_MASGN(0, NEW_POSTARG(NODE_SPECIAL_NO_NAME_REST, $3, &@$), &@$);
/*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, Qnil), $:3) %*/
Expand Down Expand Up @@ -4917,17 +4917,17 @@ f_marg : f_norm_arg
;


f_margs : mlhs(f_marg)
f_margs : mlhs_items(f_marg)
{
$$ = NEW_MASGN($1, 0, &@$);
/*% ripper: $:1 %*/
}
| mlhs(f_marg) ',' f_rest_marg
| mlhs_items(f_marg) ',' f_rest_marg
{
$$ = NEW_MASGN($1, $3, &@$);
/*% ripper: mlhs_add_star!($:1, $:3) %*/
}
| mlhs(f_marg) ',' f_rest_marg ',' mlhs(f_marg)
| mlhs_items(f_marg) ',' f_rest_marg ',' mlhs_items(f_marg)
{
$$ = NEW_MASGN($1, NEW_POSTARG($3, $5, &@$), &@$);
/*% ripper: mlhs_add_post!(mlhs_add_star!($:1, $:3), $:5) %*/
Expand All @@ -4937,7 +4937,7 @@ f_margs : mlhs(f_marg)
$$ = NEW_MASGN(0, $1, &@$);
/*% ripper: mlhs_add_star!(mlhs_new!, $:1) %*/
}
| f_rest_marg ',' mlhs(f_marg)
| f_rest_marg ',' mlhs_items(f_marg)
{
$$ = NEW_MASGN(0, NEW_POSTARG($1, $3, &@$), &@$);
/*% ripper: mlhs_add_post!(mlhs_add_star!(mlhs_new!, $:1), $:3) %*/
Expand Down