mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 07:34:45 +01:00
Require that InvalidParse nodes must have an error (#4482)
Unifies some boilerplate AddLeafNode calls for InvalidParse, and checks has_error in AddNode.
This commit is contained in:
@@ -176,8 +176,7 @@ auto HandleMatchCaseAfterPattern(Context& context) -> void {
|
||||
|
||||
context.AddLeafNode(NodeKind::MatchCaseGuardStart, *context.position(),
|
||||
true);
|
||||
context.AddLeafNode(NodeKind::InvalidParse, *context.position(),
|
||||
/*has_error=*/true);
|
||||
context.AddInvalidParse(*context.position());
|
||||
state = context.PopState();
|
||||
context.AddNode(NodeKind::MatchCaseGuard, *context.position(),
|
||||
/*has_error=*/true);
|
||||
|
||||
Reference in New Issue
Block a user