Change StructLiteral and StructTypeLiteral parsing to use an ambiguous start. (#2396)

This is necessary in order to use a bracketing approach; parsing doesn't know the contained format until it parses the first element, which we don't want to do look-ahead for. I think the bracketing is higher value than knowing the format before adding the node.
This commit is contained in:
Jon Ross-Perkins
2022-11-15 22:44:57 -08:00
committed by GitHub
parent b914f46ec5
commit c165ab6c2b
3 changed files with 17 additions and 21 deletions
+1 -1
View File
@@ -77,10 +77,10 @@ CARBON_PARSE_NODE_KIND(PostfixOperator)
// Struct literals.
CARBON_PARSE_NODE_KIND(StructLiteral)
CARBON_PARSE_NODE_KIND(StructTypeLiteral)
CARBON_PARSE_NODE_KIND(StructLiteralOrTypeLiteralStart)
CARBON_PARSE_NODE_KIND(StructFieldDesignator)
CARBON_PARSE_NODE_KIND(StructFieldValue)
CARBON_PARSE_NODE_KIND(StructFieldType)
CARBON_PARSE_NODE_KIND(StructComma)
CARBON_PARSE_NODE_KIND(StructEnd)
#undef CARBON_PARSE_NODE_KIND