Add PushState overload to combine Parse::State change with StateStackEntry (#3485)

Shortens a common `PushState` pattern
This commit is contained in:
josh11b
2023-12-08 23:58:30 +00:00
committed by GitHub
parent 6e65a30b5d
commit b7d129b88c
17 changed files with 47 additions and 87 deletions
+1 -2
View File
@@ -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`.