@@ -1145,7 +1145,7 @@ static rb_node_alias_t *rb_node_alias_new(struct parser_params *p, NODE *nd_1st,
1145
1145
static rb_node_valias_t *rb_node_valias_new(struct parser_params *p, ID nd_alias, ID nd_orig, const YYLTYPE *loc, const YYLTYPE *keyword_loc);
1146
1146
static rb_node_undef_t *rb_node_undef_new(struct parser_params *p, NODE *nd_undef, const YYLTYPE *loc);
1147
1147
static rb_node_class_t *rb_node_class_new(struct parser_params *p, NODE *nd_cpath, NODE *nd_body, NODE *nd_super, const YYLTYPE *loc, const YYLTYPE *class_keyword_loc, const YYLTYPE *inheritance_operator_loc, const YYLTYPE *end_keyword_loc);
1148
- static rb_node_module_t *rb_node_module_new(struct parser_params *p, NODE *nd_cpath, NODE *nd_body, const YYLTYPE *loc);
1148
+ static rb_node_module_t *rb_node_module_new(struct parser_params *p, NODE *nd_cpath, NODE *nd_body, const YYLTYPE *loc, const YYLTYPE *module_keyword_loc, const YYLTYPE *end_keyword_loc );
1149
1149
static rb_node_sclass_t *rb_node_sclass_new(struct parser_params *p, NODE *nd_recv, NODE *nd_body, const YYLTYPE *loc);
1150
1150
static rb_node_colon2_t *rb_node_colon2_new(struct parser_params *p, NODE *nd_head, ID nd_mid, const YYLTYPE *loc, const YYLTYPE *delimiter_loc, const YYLTYPE *name_loc);
1151
1151
static rb_node_colon3_t *rb_node_colon3_new(struct parser_params *p, ID nd_mid, const YYLTYPE *loc, const YYLTYPE *delimiter_loc, const YYLTYPE *name_loc);
@@ -1253,7 +1253,7 @@ static rb_node_error_t *rb_node_error_new(struct parser_params *p, const YYLTYPE
1253
1253
#define NEW_VALIAS(n,o,loc,k_loc) (NODE *)rb_node_valias_new(p,n,o,loc,k_loc)
1254
1254
#define NEW_UNDEF(i,loc) (NODE *)rb_node_undef_new(p,i,loc)
1255
1255
#define NEW_CLASS(n,b,s,loc,ck_loc,io_loc,ek_loc) (NODE *)rb_node_class_new(p,n,b,s,loc,ck_loc,io_loc,ek_loc)
1256
- #define NEW_MODULE(n,b,loc) (NODE *)rb_node_module_new(p,n,b,loc)
1256
+ #define NEW_MODULE(n,b,loc,mk_loc,ek_loc ) (NODE *)rb_node_module_new(p,n,b,loc,mk_loc,ek_loc )
1257
1257
#define NEW_SCLASS(r,b,loc) (NODE *)rb_node_sclass_new(p,r,b,loc)
1258
1258
#define NEW_COLON2(c,i,loc,d_loc,n_loc) (NODE *)rb_node_colon2_new(p,c,i,loc,d_loc,n_loc)
1259
1259
#define NEW_COLON3(i,loc,d_loc,n_loc) (NODE *)rb_node_colon3_new(p,i,loc,d_loc,n_loc)
@@ -4621,7 +4621,7 @@ primary : inline_primary
4621
4621
bodystmt
4622
4622
k_end
4623
4623
{
4624
- $$ = NEW_MODULE($cpath, $bodystmt, &@$);
4624
+ $$ = NEW_MODULE($cpath, $bodystmt, &@$, &@k_module, &@k_end );
4625
4625
nd_set_line(RNODE_MODULE($$)->nd_body, @k_end.end_pos.lineno);
4626
4626
set_line_body($bodystmt, @cpath.end_pos.lineno);
4627
4627
nd_set_line($$, @cpath.end_pos.lineno);
@@ -11438,13 +11438,15 @@ rb_node_sclass_new(struct parser_params *p, NODE *nd_recv, NODE *nd_body, const
11438
11438
}
11439
11439
11440
11440
static rb_node_module_t *
11441
- rb_node_module_new(struct parser_params *p, NODE *nd_cpath, NODE *nd_body, const YYLTYPE *loc)
11441
+ rb_node_module_new(struct parser_params *p, NODE *nd_cpath, NODE *nd_body, const YYLTYPE *loc, const YYLTYPE *module_keyword_loc, const YYLTYPE *end_keyword_loc )
11442
11442
{
11443
11443
/* Keep the order of node creation */
11444
11444
NODE *scope = NEW_SCOPE(0, nd_body, loc);
11445
11445
rb_node_module_t *n = NODE_NEWNODE(NODE_MODULE, rb_node_module_t, loc);
11446
11446
n->nd_cpath = nd_cpath;
11447
11447
n->nd_body = scope;
11448
+ n->module_keyword_loc = *module_keyword_loc;
11449
+ n->end_keyword_loc = *end_keyword_loc;
11448
11450
11449
11451
return n;
11450
11452
}
0 commit comments