Formalize Labeled Syntax

This represents labeled statements as an explicit kind of statement and removes the Labeled trait. Any kind of statement is allowed to be labeled in the tree, but we specifically diagnose the syntax elements that aren't allowed to have labels. This homogenizes the way clients deal with statement labels and also makes parser recovery quite a bit easier in the case where we have a label but no actual statement following it.
This commit is contained in:
Robert Widmann
2022-08-04 14:02:00 -07:00
parent 0b32290f48
commit 845a4e4541
6 changed files with 35 additions and 54 deletions

View File

@@ -268,6 +268,7 @@ SYNTAX_NODE_SERIALIZATION_CODES = {
'MissingType': 264,
'MissingPattern': 265,
'GarbageNodes' : 266,
'LabeledStmt': 267,
}