mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-01 17:35:53 +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:
@@ -67,9 +67,8 @@ auto HandleBindingPattern(Context& context) -> void {
|
||||
context.PushStateForExpr(PrecedenceGroup::ForType());
|
||||
} else {
|
||||
on_error(/*expected_name=*/false);
|
||||
// Add a placeholder for the type.
|
||||
context.AddLeafNode(NodeKind::InvalidParse, *context.position(),
|
||||
/*has_error=*/true);
|
||||
// Add a substitute for a type node.
|
||||
context.AddInvalidParse(*context.position());
|
||||
context.PushState(state, State::BindingPatternFinishAsRegular);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user