@@ -450,8 +450,8 @@ yp_flip_flop(yp_node_t *node) {
450
450
case YP_NODE_PARENTHESES_NODE: {
451
451
yp_parentheses_node_t *cast = (yp_parentheses_node_t *) node;
452
452
453
- if ((cast->statements != NULL) && YP_NODE_TYPE_P(cast->statements , YP_NODE_STATEMENTS_NODE)) {
454
- yp_statements_node_t *statements = (yp_statements_node_t *) cast->statements ;
453
+ if ((cast->body != NULL) && YP_NODE_TYPE_P(cast->body , YP_NODE_STATEMENTS_NODE)) {
454
+ yp_statements_node_t *statements = (yp_statements_node_t *) cast->body ;
455
455
if (statements->body.size == 1) yp_flip_flop(statements->body.nodes[0]);
456
456
}
457
457
@@ -1018,7 +1018,7 @@ yp_block_argument_node_create(yp_parser_t *parser, const yp_token_t *operator, y
1018
1018
1019
1019
// Allocate and initialize a new BlockNode node.
1020
1020
static yp_block_node_t *
1021
- yp_block_node_create(yp_parser_t *parser, yp_constant_id_list_t *locals, const yp_token_t *opening, yp_block_parameters_node_t *parameters, yp_node_t *statements , const yp_token_t *closing) {
1021
+ yp_block_node_create(yp_parser_t *parser, yp_constant_id_list_t *locals, const yp_token_t *opening, yp_block_parameters_node_t *parameters, yp_node_t *body , const yp_token_t *closing) {
1022
1022
yp_block_node_t *node = YP_ALLOC_NODE(parser, yp_block_node_t);
1023
1023
1024
1024
*node = (yp_block_node_t) {
@@ -1028,7 +1028,7 @@ yp_block_node_create(yp_parser_t *parser, yp_constant_id_list_t *locals, const y
1028
1028
},
1029
1029
.locals = *locals,
1030
1030
.parameters = parameters,
1031
- .statements = statements ,
1031
+ .body = body ,
1032
1032
.opening_loc = YP_LOCATION_TOKEN_VALUE(opening),
1033
1033
.closing_loc = YP_LOCATION_TOKEN_VALUE(closing)
1034
1034
};
@@ -1486,7 +1486,7 @@ yp_case_node_end_keyword_loc_set(yp_case_node_t *node, const yp_token_t *end_key
1486
1486
1487
1487
// Allocate a new ClassNode node.
1488
1488
static yp_class_node_t *
1489
- yp_class_node_create(yp_parser_t *parser, yp_constant_id_list_t *locals, const yp_token_t *class_keyword, yp_node_t *constant_path, const yp_token_t *inheritance_operator, yp_node_t *superclass, yp_node_t *statements , const yp_token_t *end_keyword) {
1489
+ yp_class_node_create(yp_parser_t *parser, yp_constant_id_list_t *locals, const yp_token_t *class_keyword, yp_node_t *constant_path, const yp_token_t *inheritance_operator, yp_node_t *superclass, yp_node_t *body , const yp_token_t *end_keyword) {
1490
1490
yp_class_node_t *node = YP_ALLOC_NODE(parser, yp_class_node_t);
1491
1491
1492
1492
*node = (yp_class_node_t) {
@@ -1499,7 +1499,7 @@ yp_class_node_create(yp_parser_t *parser, yp_constant_id_list_t *locals, const y
1499
1499
.constant_path = constant_path,
1500
1500
.inheritance_operator_loc = YP_OPTIONAL_LOCATION_TOKEN_VALUE(inheritance_operator),
1501
1501
.superclass = superclass,
1502
- .statements = statements ,
1502
+ .body = body ,
1503
1503
.end_keyword_loc = YP_LOCATION_TOKEN_VALUE(end_keyword)
1504
1504
};
1505
1505
@@ -1616,7 +1616,7 @@ yp_def_node_create(
1616
1616
const yp_token_t *name,
1617
1617
yp_node_t *receiver,
1618
1618
yp_parameters_node_t *parameters,
1619
- yp_node_t *statements ,
1619
+ yp_node_t *body ,
1620
1620
yp_constant_id_list_t *locals,
1621
1621
const yp_token_t *def_keyword,
1622
1622
const yp_token_t *operator,
@@ -1629,7 +1629,7 @@ yp_def_node_create(
1629
1629
const char *end;
1630
1630
1631
1631
if (end_keyword->type == YP_TOKEN_NOT_PROVIDED) {
1632
- end = statements ->location.end;
1632
+ end = body ->location.end;
1633
1633
} else {
1634
1634
end = end_keyword->end;
1635
1635
}
@@ -1642,7 +1642,7 @@ yp_def_node_create(
1642
1642
.name_loc = YP_LOCATION_TOKEN_VALUE(name),
1643
1643
.receiver = receiver,
1644
1644
.parameters = parameters,
1645
- .statements = statements ,
1645
+ .body = body ,
1646
1646
.locals = *locals,
1647
1647
.def_keyword_loc = YP_LOCATION_TOKEN_VALUE(def_keyword),
1648
1648
.operator_loc = YP_OPTIONAL_LOCATION_TOKEN_VALUE(operator),
@@ -2553,7 +2553,7 @@ yp_lambda_node_create(
2553
2553
yp_constant_id_list_t *locals,
2554
2554
const yp_token_t *opening,
2555
2555
yp_block_parameters_node_t *parameters,
2556
- yp_node_t *statements ,
2556
+ yp_node_t *body ,
2557
2557
const yp_token_t *closing
2558
2558
) {
2559
2559
yp_lambda_node_t *node = YP_ALLOC_NODE(parser, yp_lambda_node_t);
@@ -2569,7 +2569,7 @@ yp_lambda_node_create(
2569
2569
.locals = *locals,
2570
2570
.opening_loc = YP_LOCATION_TOKEN_VALUE(opening),
2571
2571
.parameters = parameters,
2572
- .statements = statements
2572
+ .body = body
2573
2573
};
2574
2574
2575
2575
return node;
@@ -2679,7 +2679,7 @@ yp_match_required_node_create(yp_parser_t *parser, yp_node_t *value, yp_node_t *
2679
2679
2680
2680
// Allocate a new ModuleNode node.
2681
2681
static yp_module_node_t *
2682
- yp_module_node_create(yp_parser_t *parser, yp_constant_id_list_t *locals, const yp_token_t *module_keyword, yp_node_t *constant_path, yp_node_t *statements , const yp_token_t *end_keyword) {
2682
+ yp_module_node_create(yp_parser_t *parser, yp_constant_id_list_t *locals, const yp_token_t *module_keyword, yp_node_t *constant_path, yp_node_t *body , const yp_token_t *end_keyword) {
2683
2683
yp_module_node_t *node = YP_ALLOC_NODE(parser, yp_module_node_t);
2684
2684
2685
2685
*node = (yp_module_node_t) {
@@ -2693,7 +2693,7 @@ yp_module_node_create(yp_parser_t *parser, yp_constant_id_list_t *locals, const
2693
2693
.locals = (locals == NULL ? ((yp_constant_id_list_t) { .ids = NULL, .size = 0, .capacity = 0 }) : *locals),
2694
2694
.module_keyword_loc = YP_LOCATION_TOKEN_VALUE(module_keyword),
2695
2695
.constant_path = constant_path,
2696
- .statements = statements ,
2696
+ .body = body ,
2697
2697
.end_keyword_loc = YP_LOCATION_TOKEN_VALUE(end_keyword)
2698
2698
};
2699
2699
@@ -3006,7 +3006,7 @@ yp_program_node_create(yp_parser_t *parser, yp_constant_id_list_t *locals, yp_st
3006
3006
3007
3007
// Allocate and initialize new ParenthesesNode node.
3008
3008
static yp_parentheses_node_t *
3009
- yp_parentheses_node_create(yp_parser_t *parser, const yp_token_t *opening, yp_node_t *statements , const yp_token_t *closing) {
3009
+ yp_parentheses_node_create(yp_parser_t *parser, const yp_token_t *opening, yp_node_t *body , const yp_token_t *closing) {
3010
3010
yp_parentheses_node_t *node = YP_ALLOC_NODE(parser, yp_parentheses_node_t);
3011
3011
3012
3012
*node = (yp_parentheses_node_t) {
@@ -3017,7 +3017,7 @@ yp_parentheses_node_create(yp_parser_t *parser, const yp_token_t *opening, yp_no
3017
3017
.end = closing->end
3018
3018
}
3019
3019
},
3020
- .statements = statements ,
3020
+ .body = body ,
3021
3021
.opening_loc = YP_LOCATION_TOKEN_VALUE(opening),
3022
3022
.closing_loc = YP_LOCATION_TOKEN_VALUE(closing)
3023
3023
};
@@ -3363,7 +3363,7 @@ yp_self_node_create(yp_parser_t *parser, const yp_token_t *token) {
3363
3363
3364
3364
// Allocate a new SingletonClassNode node.
3365
3365
static yp_singleton_class_node_t *
3366
- yp_singleton_class_node_create(yp_parser_t *parser, yp_constant_id_list_t *locals, const yp_token_t *class_keyword, const yp_token_t *operator, yp_node_t *expression, yp_node_t *statements , const yp_token_t *end_keyword) {
3366
+ yp_singleton_class_node_create(yp_parser_t *parser, yp_constant_id_list_t *locals, const yp_token_t *class_keyword, const yp_token_t *operator, yp_node_t *expression, yp_node_t *body , const yp_token_t *end_keyword) {
3367
3367
yp_singleton_class_node_t *node = YP_ALLOC_NODE(parser, yp_singleton_class_node_t);
3368
3368
3369
3369
*node = (yp_singleton_class_node_t) {
@@ -3378,7 +3378,7 @@ yp_singleton_class_node_create(yp_parser_t *parser, yp_constant_id_list_t *local
3378
3378
.class_keyword_loc = YP_LOCATION_TOKEN_VALUE(class_keyword),
3379
3379
.operator_loc = YP_LOCATION_TOKEN_VALUE(operator),
3380
3380
.expression = expression,
3381
- .statements = statements ,
3381
+ .body = body ,
3382
3382
.end_keyword_loc = YP_LOCATION_TOKEN_VALUE(end_keyword)
3383
3383
};
3384
3384
0 commit comments