mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Refactor match parse nodes. (#6870)
Use the same node kind for the body of `case` and `default` handlers. We don't need to distinguish these in check, so don't create extra node kinds for them. In order to make the nodes properly delimited, make the label (`case ...` or `default`) nodes be children of the `=>` node rather than siblings. This allows us to use the node kind of the `=>` as the bracketing node for the complete handler, rather than having two different bracketing node kinds, one for each kind of label.
This commit is contained in:
@@ -513,18 +513,16 @@ class NodeStack {
|
||||
case Parse::NodeKind::InlineImportSpecifier:
|
||||
case Parse::NodeKind::InlineImportBody:
|
||||
case Parse::NodeKind::MatchCase:
|
||||
case Parse::NodeKind::MatchCaseEqualGreater:
|
||||
case Parse::NodeKind::MatchCaseGuard:
|
||||
case Parse::NodeKind::MatchCaseGuardIntroducer:
|
||||
case Parse::NodeKind::MatchCaseGuardStart:
|
||||
case Parse::NodeKind::MatchCaseIntroducer:
|
||||
case Parse::NodeKind::MatchCaseStart:
|
||||
case Parse::NodeKind::MatchCondition:
|
||||
case Parse::NodeKind::MatchConditionStart:
|
||||
case Parse::NodeKind::MatchDefault:
|
||||
case Parse::NodeKind::MatchDefaultEqualGreater:
|
||||
case Parse::NodeKind::MatchDefaultIntroducer:
|
||||
case Parse::NodeKind::MatchDefaultStart:
|
||||
case Parse::NodeKind::MatchHandlerStart:
|
||||
case Parse::NodeKind::MatchHandler:
|
||||
case Parse::NodeKind::MatchIntroducer:
|
||||
case Parse::NodeKind::MatchStatementStart:
|
||||
case Parse::NodeKind::NamespaceStart:
|
||||
|
||||
Reference in New Issue
Block a user