Skip to content

Commit ad0eb4b

Browse files
committed
Rename RescueNode#exception to RescueNode#reference
1 parent 5646158 commit ad0eb4b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,7 @@ nodes:
18301830
type: node[]
18311831
- name: operator_loc
18321832
type: location?
1833-
- name: exception
1833+
- name: reference
18341834
type: node?
18351835
- name: statements
18361836
type: node?

src/yarp.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3517,7 +3517,7 @@ yp_rescue_node_create(yp_parser_t *parser, const yp_token_t *keyword) {
35173517
},
35183518
.keyword_loc = YP_LOCATION_TOKEN_VALUE(keyword),
35193519
.operator_loc = YP_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE,
3520-
.exception = NULL,
3520+
.reference = NULL,
35213521
.statements = NULL,
35223522
.consequent = NULL,
35233523
.exceptions = YP_EMPTY_NODE_LIST
@@ -3531,11 +3531,11 @@ yp_rescue_node_operator_set(yp_rescue_node_t *node, const yp_token_t *operator)
35313531
node->operator_loc = YP_OPTIONAL_LOCATION_TOKEN_VALUE(operator);
35323532
}
35333533

3534-
// Set the exception of a rescue node, and update the location of the node.
3534+
// Set the reference of a rescue node, and update the location of the node.
35353535
static void
3536-
yp_rescue_node_exception_set(yp_rescue_node_t *node, yp_node_t *exception) {
3537-
node->exception = exception;
3538-
node->base.location.end = exception->location.end;
3536+
yp_rescue_node_reference_set(yp_rescue_node_t *node, yp_node_t *reference) {
3537+
node->reference = reference;
3538+
node->base.location.end = reference->location.end;
35393539
}
35403540

35413541
// Set the statements of a rescue node, and update the location of the node.
@@ -8610,11 +8610,11 @@ parse_rescues(yp_parser_t *parser, yp_begin_node_t *parent_node) {
86108610
parser_lex(parser);
86118611
yp_rescue_node_operator_set(rescue, &parser->previous);
86128612

8613-
yp_node_t *node = parse_expression(parser, YP_BINDING_POWER_INDEX, "Expected an exception variable after `=>` in rescue statement.");
8613+
yp_node_t *reference = parse_expression(parser, YP_BINDING_POWER_INDEX, "Expected an exception variable after `=>` in rescue statement.");
86148614
yp_token_t operator = not_provided(parser);
8615-
node = parse_target(parser, node, &operator, NULL);
8615+
reference = parse_target(parser, reference, &operator, NULL);
86168616

8617-
rescue->exception = node;
8617+
yp_rescue_node_reference_set(rescue, reference);
86188618
break;
86198619
}
86208620
case YP_TOKEN_NEWLINE:
@@ -8641,11 +8641,11 @@ parse_rescues(yp_parser_t *parser, yp_begin_node_t *parent_node) {
86418641
if (accept(parser, YP_TOKEN_EQUAL_GREATER)) {
86428642
yp_rescue_node_operator_set(rescue, &parser->previous);
86438643

8644-
yp_node_t *node = parse_expression(parser, YP_BINDING_POWER_INDEX, "Expected an exception variable after `=>` in rescue statement.");
8644+
yp_node_t *reference = parse_expression(parser, YP_BINDING_POWER_INDEX, "Expected an exception variable after `=>` in rescue statement.");
86458645
yp_token_t operator = not_provided(parser);
8646-
node = parse_target(parser, node, &operator, NULL);
8646+
reference = parse_target(parser, reference, &operator, NULL);
86478647

8648-
yp_rescue_node_exception_set(rescue, node);
8648+
yp_rescue_node_reference_set(rescue, reference);
86498649
break;
86508650
}
86518651
} while (accept(parser, YP_TOKEN_COMMA));

0 commit comments

Comments
 (0)