@@ -1958,14 +1958,14 @@ pm_node_alloc(PRISM_ATTRIBUTE_UNUSED pm_parser_t *parser, size_t size) {
19581958#define PM_NODE_INIT_NODE_TOKEN(parser_, type_, flags_, node_, token_) PM_NODE_INIT(parser_, type_, flags_, PM_NODE_START(node_), PM_TOKEN_END(token_))
19591959
19601960/**
1961- * Allocate a new MissingNode node.
1961+ * Allocate a new ErrorRecoveryNode node to represent a missing node.
19621962 */
1963- static pm_missing_node_t *
1963+ static pm_error_recovery_node_t *
19641964pm_missing_node_create(pm_parser_t *parser, const uint8_t *start, const uint8_t *end) {
1965- pm_missing_node_t *node = PM_NODE_ALLOC(parser, pm_missing_node_t );
1965+ pm_error_recovery_node_t *node = PM_NODE_ALLOC(parser, pm_error_recovery_node_t );
19661966
1967- *node = (pm_missing_node_t ) {
1968- .base = PM_NODE_INIT(parser, PM_MISSING_NODE , 0, start, end)
1967+ *node = (pm_error_recovery_node_t ) {
1968+ .base = PM_NODE_INIT(parser, PM_ERROR_RECOVERY_NODE , 0, start, end)
19691969 };
19701970
19711971 return node;
@@ -3788,7 +3788,7 @@ pm_find_pattern_node_create(pm_parser_t *parser, pm_node_list_t *nodes) {
37883788 }
37893789
37903790#if PRISM_SERIALIZE_ONLY_SEMANTICS_FIELDS
3791- // FindPatternNode#right is typed as SplatNode in this case, so replace the potential MissingNode with a SplatNode.
3791+ // FindPatternNode#right is typed as SplatNode in this case, so replace the potential ErrorRecoveryNode with a SplatNode.
37923792 // The resulting AST will anyway be ignored, but this file still needs to compile.
37933793 pm_splat_node_t *right_splat_node = PM_NODE_TYPE_P(right, PM_SPLAT_NODE) ? (pm_splat_node_t *) right : left_splat_node;
37943794#else
@@ -12677,7 +12677,7 @@ parse_unwriteable_target(pm_parser_t *parser, pm_node_t *target) {
1267712677static pm_node_t *
1267812678parse_target(pm_parser_t *parser, pm_node_t *target, bool multiple, bool splat_parent) {
1267912679 switch (PM_NODE_TYPE(target)) {
12680- case PM_MISSING_NODE :
12680+ case PM_ERROR_RECOVERY_NODE :
1268112681 return target;
1268212682 case PM_SOURCE_ENCODING_NODE:
1268312683 case PM_FALSE_NODE:
@@ -12867,7 +12867,7 @@ parse_shareable_constant_write(pm_parser_t *parser, pm_node_t *write) {
1286712867static pm_node_t *
1286812868parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_node_t *value) {
1286912869 switch (PM_NODE_TYPE(target)) {
12870- case PM_MISSING_NODE :
12870+ case PM_ERROR_RECOVERY_NODE :
1287112871 pm_node_destroy(parser, value);
1287212872 return target;
1287312873 case PM_CLASS_VARIABLE_READ_NODE: {
@@ -13220,7 +13220,7 @@ parse_statements(pm_parser_t *parser, pm_context_t context, uint16_t depth) {
1322013220 // we were unable to parse an expression, then we will skip past this
1322113221 // token and continue parsing the statements list. Otherwise we'll add
1322213222 // an error and continue parsing the statements list.
13223- if (PM_NODE_TYPE_P(node, PM_MISSING_NODE )) {
13223+ if (PM_NODE_TYPE_P(node, PM_ERROR_RECOVERY_NODE )) {
1322413224 parser_lex(parser);
1322513225
1322613226 // If we are at the end of the file, then we need to stop parsing
@@ -13661,7 +13661,7 @@ parse_arguments(pm_parser_t *parser, pm_arguments_t *arguments, bool accepts_for
1366113661 parsed_first_argument = true;
1366213662
1366313663 // If parsing the argument failed, we need to stop parsing arguments.
13664- if (PM_NODE_TYPE_P(argument, PM_MISSING_NODE ) || parser->recovering) break;
13664+ if (PM_NODE_TYPE_P(argument, PM_ERROR_RECOVERY_NODE ) || parser->recovering) break;
1366513665
1366613666 // If the terminator of these arguments is not EOF, then we have a
1366713667 // specific token we're looking for. In that case we can accept a
@@ -16729,7 +16729,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm
1672916729 // Call nodes (arithmetic operations) are not allowed in patterns
1673016730 if (PM_NODE_TYPE(node) == PM_CALL_NODE) {
1673116731 pm_parser_err_node(parser, node, diag_id);
16732- pm_missing_node_t *missing_node = pm_missing_node_create(parser, node->location.start, node->location.end);
16732+ pm_error_recovery_node_t *missing_node = pm_missing_node_create(parser, node->location.start, node->location.end);
1673316733
1673416734 pm_node_unreference(parser, node);
1673516735 pm_node_destroy(parser, node);
@@ -17521,7 +17521,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b
1752117521 }
1752217522
1752317523 pm_array_node_elements_append(array, element);
17524- if (PM_NODE_TYPE_P(element, PM_MISSING_NODE )) break;
17524+ if (PM_NODE_TYPE_P(element, PM_ERROR_RECOVERY_NODE )) break;
1752517525 }
1752617526
1752717527 accept1(parser, PM_TOKEN_NEWLINE);
@@ -17697,7 +17697,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b
1769717697
1769817698 // If we couldn't parse an expression at all, then we need to
1769917699 // bail out of the loop.
17700- if (PM_NODE_TYPE_P(node, PM_MISSING_NODE )) break;
17700+ if (PM_NODE_TYPE_P(node, PM_ERROR_RECOVERY_NODE )) break;
1770117701
1770217702 // If we successfully parsed a statement, then we are going to
1770317703 // need terminator to delimit them.
@@ -18248,14 +18248,14 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b
1824818248 pm_splat_node_t *splat_node = pm_splat_node_create(parser, &operator, expression);
1824918249 pm_when_node_conditions_append(when_node, UP(splat_node));
1825018250
18251- if (PM_NODE_TYPE_P(expression, PM_MISSING_NODE )) break;
18251+ if (PM_NODE_TYPE_P(expression, PM_ERROR_RECOVERY_NODE )) break;
1825218252 } else {
1825318253 pm_node_t *condition = parse_value_expression(parser, PM_BINDING_POWER_DEFINED, false, false, PM_ERR_CASE_EXPRESSION_AFTER_WHEN, (uint16_t) (depth + 1));
1825418254 pm_when_node_conditions_append(when_node, condition);
1825518255
1825618256 // If we found a missing node, then this is a syntax
1825718257 // error and we should stop looping.
18258- if (PM_NODE_TYPE_P(condition, PM_MISSING_NODE )) break;
18258+ if (PM_NODE_TYPE_P(condition, PM_ERROR_RECOVERY_NODE )) break;
1825918259
1826018260 // If this is a string node, then we need to mark it
1826118261 // as frozen because when clause strings are frozen.
@@ -19134,7 +19134,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b
1913419134 pm_undef_node_t *undef = pm_undef_node_create(parser, &parser->previous);
1913519135 pm_node_t *name = parse_undef_argument(parser, (uint16_t) (depth + 1));
1913619136
19137- if (PM_NODE_TYPE_P(name, PM_MISSING_NODE )) {
19137+ if (PM_NODE_TYPE_P(name, PM_ERROR_RECOVERY_NODE )) {
1913819138 pm_node_destroy(parser, name);
1913919139 } else {
1914019140 pm_undef_node_append(undef, name);
@@ -19144,7 +19144,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b
1914419144 parser_lex(parser);
1914519145 name = parse_undef_argument(parser, (uint16_t) (depth + 1));
1914619146
19147- if (PM_NODE_TYPE_P(name, PM_MISSING_NODE )) {
19147+ if (PM_NODE_TYPE_P(name, PM_ERROR_RECOVERY_NODE )) {
1914819148 pm_node_destroy(parser, name);
1914919149 break;
1915019150 }
@@ -19218,7 +19218,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b
1921819218
1921919219 // If we can recover from a syntax error that occurred while parsing
1922019220 // the name of the module, then we'll handle that here.
19221- if (PM_NODE_TYPE_P(constant_path, PM_MISSING_NODE )) {
19221+ if (PM_NODE_TYPE_P(constant_path, PM_ERROR_RECOVERY_NODE )) {
1922219222 pop_block_exits(parser, previous_block_exits);
1922319223 pm_node_list_free(¤t_block_exits);
1922419224
@@ -20291,7 +20291,7 @@ parse_assignment_values(pm_parser_t *parser, pm_binding_power_t previous_binding
2029120291 pm_node_t *element = parse_starred_expression(parser, binding_power, false, PM_ERR_ARRAY_ELEMENT, (uint16_t) (depth + 1));
2029220292
2029320293 pm_array_node_elements_append(array, element);
20294- if (PM_NODE_TYPE_P(element, PM_MISSING_NODE )) break;
20294+ if (PM_NODE_TYPE_P(element, PM_ERROR_RECOVERY_NODE )) break;
2029520295
2029620296 parse_assignment_value_local(parser, element);
2029720297 }
@@ -21584,7 +21584,7 @@ parse_expression(pm_parser_t *parser, pm_binding_power_t binding_power, bool acc
2158421584 pm_node_t *node = parse_expression_prefix(parser, binding_power, accepts_command_call, accepts_label, diag_id, depth);
2158521585
2158621586 switch (PM_NODE_TYPE(node)) {
21587- case PM_MISSING_NODE :
21587+ case PM_ERROR_RECOVERY_NODE :
2158821588 // If we found a syntax error, then the type of node returned by
2158921589 // parse_expression_prefix is going to be a missing node.
2159021590 return node;
0 commit comments