@@ -1075,7 +1075,7 @@ static rb_node_for_masgn_t *rb_node_for_masgn_new(struct parser_params *p, NODE
1075
1075
static rb_node_retry_t *rb_node_retry_new(struct parser_params *p, const YYLTYPE *loc);
1076
1076
static rb_node_begin_t *rb_node_begin_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc);
1077
1077
static rb_node_rescue_t *rb_node_rescue_new(struct parser_params *p, NODE *nd_head, NODE *nd_resq, NODE *nd_else, const YYLTYPE *loc);
1078
- static rb_node_resbody_t *rb_node_resbody_new(struct parser_params *p, NODE *nd_args, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc);
1078
+ static rb_node_resbody_t *rb_node_resbody_new(struct parser_params *p, NODE *nd_args, NODE *nd_exc_var, NODE * nd_body, NODE *nd_next, const YYLTYPE *loc);
1079
1079
static rb_node_ensure_t *rb_node_ensure_new(struct parser_params *p, NODE *nd_head, NODE *nd_ensr, const YYLTYPE *loc);
1080
1080
static rb_node_and_t *rb_node_and_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc);
1081
1081
static rb_node_or_t *rb_node_or_new(struct parser_params *p, NODE *nd_1st, NODE *nd_2nd, const YYLTYPE *loc);
@@ -1183,7 +1183,7 @@ static rb_node_error_t *rb_node_error_new(struct parser_params *p, const YYLTYPE
1183
1183
#define NEW_RETRY(loc) (NODE *)rb_node_retry_new(p,loc)
1184
1184
#define NEW_BEGIN(b,loc) (NODE *)rb_node_begin_new(p,b,loc)
1185
1185
#define NEW_RESCUE(b,res,e,loc) (NODE *)rb_node_rescue_new(p,b,res,e,loc)
1186
- #define NEW_RESBODY(a,ex,n,loc) (NODE *)rb_node_resbody_new(p,a,ex,n,loc)
1186
+ #define NEW_RESBODY(a,v, ex,n,loc) (NODE *)rb_node_resbody_new(p,a,v ,ex,n,loc)
1187
1187
#define NEW_ENSURE(b,en,loc) (NODE *)rb_node_ensure_new(p,b,en,loc)
1188
1188
#define NEW_AND(f,s,loc) (NODE *)rb_node_and_new(p,f,s,loc)
1189
1189
#define NEW_OR(f,s,loc) (NODE *)rb_node_or_new(p,f,s,loc)
@@ -1645,7 +1645,7 @@ rescued_expr(struct parser_params *p, NODE *arg, NODE *rescue,
1645
1645
const YYLTYPE *arg_loc, const YYLTYPE *mod_loc, const YYLTYPE *res_loc)
1646
1646
{
1647
1647
YYLTYPE loc = code_loc_gen(mod_loc, res_loc);
1648
- rescue = NEW_RESBODY(0, remove_begin(rescue), 0, &loc);
1648
+ rescue = NEW_RESBODY(0, 0, remove_begin(rescue), 0, &loc);
1649
1649
loc.beg_pos = arg_loc->beg_pos;
1650
1650
return NEW_RESCUE(arg, rescue, 0, &loc);
1651
1651
}
@@ -3204,7 +3204,7 @@ stmt : keyword_alias fitem {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem
3204
3204
p->ctxt.in_rescue = $3.in_rescue;
3205
3205
NODE *resq;
3206
3206
YYLTYPE loc = code_loc_gen(&@2, &@4);
3207
- resq = NEW_RESBODY(0, remove_begin($4), 0, &loc);
3207
+ resq = NEW_RESBODY(0, 0, remove_begin($4), 0, &loc);
3208
3208
$$ = NEW_RESCUE(remove_begin($1), resq, 0, &@$);
3209
3209
/*% ripper: rescue_mod!($:1, $:4) %*/
3210
3210
}
@@ -3238,7 +3238,7 @@ stmt : keyword_alias fitem {SET_LEX_STATE(EXPR_FNAME|EXPR_FITEM);} fitem
3238
3238
{
3239
3239
p->ctxt.in_rescue = $3.in_rescue;
3240
3240
YYLTYPE loc = code_loc_gen(&@modifier_rescue, &@resbody);
3241
- $resbody = NEW_RESBODY(0, remove_begin($resbody), 0, &loc);
3241
+ $resbody = NEW_RESBODY(0, 0, remove_begin($resbody), 0, &loc);
3242
3242
loc.beg_pos = @mrhs_arg.beg_pos;
3243
3243
$mrhs_arg = NEW_RESCUE($mrhs_arg, $resbody, 0, &loc);
3244
3244
$$ = node_assign(p, (NODE *)$mlhs, $mrhs_arg, $lex_ctxt, &@$);
@@ -3343,7 +3343,7 @@ command_rhs : command_call %prec tOP_ASGN
3343
3343
p->ctxt.in_rescue = $3.in_rescue;
3344
3344
YYLTYPE loc = code_loc_gen(&@2, &@4);
3345
3345
value_expr($1);
3346
- $$ = NEW_RESCUE($1, NEW_RESBODY(0, remove_begin($4), 0, &loc), 0, &@$);
3346
+ $$ = NEW_RESCUE($1, NEW_RESBODY(0, 0, remove_begin($4), 0, &loc), 0, &@$);
3347
3347
/*% ripper: rescue_mod!($:1, $:4) %*/
3348
3348
}
3349
3349
| command_asgn
@@ -5960,13 +5960,12 @@ opt_rescue : k_rescue exc_list exc_var then
5960
5960
compstmt
5961
5961
opt_rescue
5962
5962
{
5963
- NODE *body = $5 ;
5963
+ NODE *err = $3 ;
5964
5964
if ($3) {
5965
- NODE * err = NEW_ERRINFO(&@3);
5965
+ err = NEW_ERRINFO(&@3);
5966
5966
err = node_assign(p, $3, err, NO_LEX_CTXT, &@3);
5967
- body = block_append(p, err, body);
5968
5967
}
5969
- $$ = NEW_RESBODY($2, body , $6, &@$);
5968
+ $$ = NEW_RESBODY($2, $3, $5 , $6, &@$);
5970
5969
if ($2) {
5971
5970
fixpos($$, $2);
5972
5971
}
@@ -11475,10 +11474,11 @@ rb_node_rescue_new(struct parser_params *p, NODE *nd_head, NODE *nd_resq, NODE *
11475
11474
}
11476
11475
11477
11476
static rb_node_resbody_t *
11478
- rb_node_resbody_new(struct parser_params *p, NODE *nd_args, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc)
11477
+ rb_node_resbody_new(struct parser_params *p, NODE *nd_args, NODE *nd_exc_var, NODE * nd_body, NODE *nd_next, const YYLTYPE *loc)
11479
11478
{
11480
11479
rb_node_resbody_t *n = NODE_NEWNODE(NODE_RESBODY, rb_node_resbody_t, loc);
11481
11480
n->nd_args = nd_args;
11481
+ n->nd_exc_var = nd_exc_var;
11482
11482
n->nd_body = nd_body;
11483
11483
n->nd_next = nd_next;
11484
11484
0 commit comments