mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 17:51:05 +01:00
Add PushState overload to combine Parse::State change with StateStackEntry (#3485)
Shortens a common `PushState` pattern
This commit is contained in:
@@ -31,9 +31,8 @@ auto HandleBindingPattern(Context& context) -> void {
|
||||
// Add a placeholder for the type.
|
||||
context.AddLeafNode(NodeKind::InvalidParse, *context.position(),
|
||||
/*has_error=*/true);
|
||||
state.state = State::BindingPatternFinishAsRegular;
|
||||
state.has_error = true;
|
||||
context.PushState(state);
|
||||
context.PushState(state, State::BindingPatternFinishAsRegular);
|
||||
};
|
||||
|
||||
// The first item should be an identifier or `self`.
|
||||
|
||||
Reference in New Issue
Block a user