Improve parsing of invalid expressions. (#2726)

This addresses crashes for infix operator expressions, but the approach should more generally yield balanced parsed trees.
This commit is contained in:
Jon Ross-Perkins
2023-03-31 20:51:59 -07:00
committed by GitHub
parent 7824e9618c
commit a905cdea30
8 changed files with 74 additions and 13 deletions
+3
View File
@@ -43,6 +43,9 @@
// The end of the file.
CARBON_PARSE_NODE_KIND_CHILD_COUNT(FileEnd, 0)
// An invalid expression. Used to balance the parse tree. Always has an error.
CARBON_PARSE_NODE_KIND_CHILD_COUNT(InvalidExpression, 0)
// An empty declaration, such as `;`.
CARBON_PARSE_NODE_KIND_CHILD_COUNT(EmptyDeclaration, 0)