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 authored and GitHub committed 2023-03-31 20:51:59 -07:00
1 parent 7824e9618c
commit a905cdea30
8 files changed
+74 -13

No files matched your search

+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)