Replace the NodeKind StructFieldUnknown with InvalidParse. (#3482)

StructFieldUnknown was used previously for invalid parses. But we have
added other, more common ways of talking about those; so this is
removing the special-case.
This commit is contained in:
Jon Ross-Perkins
2023-12-12 00:43:04 +00:00
committed by GitHub
parent 032c0e017b
commit 6cc5dc7736
19 changed files with 22 additions and 29 deletions
+1 -3
View File
@@ -613,7 +613,7 @@ CARBON_PARSE_NODE_KIND_CHILD_COUNT(IfExprElse, 3,
// may repeat with StructComma as a separator.
//
// When a valid StructFieldType or StructFieldValue cannot be formed, elements
// may be replaced by StructFieldUnknown, which may have a preceding sibling
// may be replaced by InvalidParse, which may have a preceding sibling
// StructFieldDesignator if one was successfully parsed.
CARBON_PARSE_NODE_KIND_CHILD_COUNT(StructLiteralOrStructTypeLiteralStart, 0,
CARBON_TOKEN(OpenCurlyBrace))
@@ -621,8 +621,6 @@ CARBON_PARSE_NODE_KIND_CHILD_COUNT(StructFieldDesignator, 1,
CARBON_TOKEN(Period))
CARBON_PARSE_NODE_KIND_CHILD_COUNT(StructFieldValue, 2, CARBON_TOKEN(Equal))
CARBON_PARSE_NODE_KIND_CHILD_COUNT(StructFieldType, 2, CARBON_TOKEN(Colon))
CARBON_PARSE_NODE_KIND_CHILD_COUNT(StructFieldUnknown, 0,
CARBON_IF_ERROR(CARBON_ANY_TOKEN))
CARBON_PARSE_NODE_KIND_CHILD_COUNT(StructComma, 0, CARBON_TOKEN(Comma))
CARBON_PARSE_NODE_KIND_BRACKET(StructLiteral,
StructLiteralOrStructTypeLiteralStart,