@@ -1070,7 +1070,7 @@ static rb_node_case_t *rb_node_case_new(struct parser_params *p, NODE *nd_head,
10701070static rb_node_case2_t *rb_node_case2_new(struct parser_params *p, NODE *nd_body, const YYLTYPE *loc, const YYLTYPE *case_keyword_loc, const YYLTYPE *end_keyword_loc);
10711071static rb_node_case3_t *rb_node_case3_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, const YYLTYPE *loc, const YYLTYPE *case_keyword_loc, const YYLTYPE *end_keyword_loc);
10721072static rb_node_when_t *rb_node_when_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc, const YYLTYPE *keyword_loc, const YYLTYPE *then_keyword_loc);
1073- static rb_node_in_t *rb_node_in_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc);
1073+ static rb_node_in_t *rb_node_in_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc, const YYLTYPE *in_keyword_loc, const YYLTYPE *then_keyword_loc, const YYLTYPE *operator_loc );
10741074static rb_node_while_t *rb_node_while_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, long nd_state, const YYLTYPE *loc, const YYLTYPE *keyword_loc, const YYLTYPE *closing_loc);
10751075static rb_node_until_t *rb_node_until_new(struct parser_params *p, NODE *nd_cond, NODE *nd_body, long nd_state, const YYLTYPE *loc, const YYLTYPE *keyword_loc, const YYLTYPE *closing_loc);
10761076static rb_node_iter_t *rb_node_iter_new(struct parser_params *p, rb_node_args_t *nd_args, NODE *nd_body, const YYLTYPE *loc);
@@ -1178,7 +1178,7 @@ static rb_node_error_t *rb_node_error_new(struct parser_params *p, const YYLTYPE
11781178#define NEW_CASE2(b,loc,ck_loc,ek_loc) (NODE *)rb_node_case2_new(p,b,loc,ck_loc,ek_loc)
11791179#define NEW_CASE3(h,b,loc,ck_loc,ek_loc) (NODE *)rb_node_case3_new(p,h,b,loc,ck_loc,ek_loc)
11801180#define NEW_WHEN(c,t,e,loc,k_loc,t_loc) (NODE *)rb_node_when_new(p,c,t,e,loc,k_loc,t_loc)
1181- #define NEW_IN(c,t,e,loc) (NODE *)rb_node_in_new(p,c,t,e,loc)
1181+ #define NEW_IN(c,t,e,loc,ik_loc,tk_loc,o_loc ) (NODE *)rb_node_in_new(p,c,t,e,loc,ik_loc,tk_loc,o_loc )
11821182#define NEW_WHILE(c,b,n,loc,k_loc,c_loc) (NODE *)rb_node_while_new(p,c,b,n,loc,k_loc,c_loc)
11831183#define NEW_UNTIL(c,b,n,loc,k_loc,c_loc) (NODE *)rb_node_until_new(p,c,b,n,loc,k_loc,c_loc)
11841184#define NEW_ITER(a,b,loc) (NODE *)rb_node_iter_new(p,a,b,loc)
@@ -3472,7 +3472,7 @@ expr : command_call
34723472 pop_pktbl(p, $p_pktbl);
34733473 pop_pvtbl(p, $p_pvtbl);
34743474 p->ctxt.in_kwarg = $ctxt.in_kwarg;
3475- $$ = NEW_CASE3($arg, NEW_IN($body, 0, 0, &@body), &@$, &NULL_LOC, &NULL_LOC);
3475+ $$ = NEW_CASE3($arg, NEW_IN($body, 0, 0, &@body, &NULL_LOC, &NULL_LOC, &@2 ), &@$, &NULL_LOC, &NULL_LOC);
34763476 /*% ripper: case!($:arg, in!($:body, Qnil, Qnil)) %*/
34773477 }
34783478 | arg keyword_in
@@ -3485,7 +3485,7 @@ expr : command_call
34853485 pop_pktbl(p, $p_pktbl);
34863486 pop_pvtbl(p, $p_pvtbl);
34873487 p->ctxt.in_kwarg = $ctxt.in_kwarg;
3488- $$ = NEW_CASE3($arg, NEW_IN($body, NEW_TRUE(&@body), NEW_FALSE(&@body), &@body), &@$, &NULL_LOC, &NULL_LOC);
3488+ $$ = NEW_CASE3($arg, NEW_IN($body, NEW_TRUE(&@body), NEW_FALSE(&@body), &@body, &@keyword_in, &NULL_LOC, &NULL_LOC ), &@$, &NULL_LOC, &NULL_LOC);
34893489 /*% ripper: case!($:arg, in!($:body, Qnil, Qnil)) %*/
34903490 }
34913491 | arg %prec tLBRACE_ARG
@@ -5399,7 +5399,7 @@ p_case_body : keyword_in
53995399 compstmt(stmts)
54005400 p_cases[cases]
54015401 {
5402- $$ = NEW_IN($expr, $compstmt, $cases, &@$);
5402+ $$ = NEW_IN($expr, $compstmt, $cases, &@$, &@keyword_in, &@then, &NULL_LOC );
54035403 /*% ripper: in!($:expr, $:compstmt, $:cases) %*/
54045404 }
54055405 ;
@@ -11528,12 +11528,15 @@ rb_node_when_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, NODE *nd
1152811528}
1152911529
1153011530static rb_node_in_t *
11531- rb_node_in_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc)
11531+ rb_node_in_new(struct parser_params *p, NODE *nd_head, NODE *nd_body, NODE *nd_next, const YYLTYPE *loc, const YYLTYPE *in_keyword_loc, const YYLTYPE *then_keyword_loc, const YYLTYPE *operator_loc )
1153211532{
1153311533 rb_node_in_t *n = NODE_NEWNODE(NODE_IN, rb_node_in_t, loc);
1153411534 n->nd_head = nd_head;
1153511535 n->nd_body = nd_body;
1153611536 n->nd_next = nd_next;
11537+ n->in_keyword_loc = *in_keyword_loc;
11538+ n->then_keyword_loc = *then_keyword_loc;
11539+ n->operator_loc = *operator_loc;
1153711540
1153811541 return n;
1153911542}
0 commit comments