mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Add PushState overload to combine Parse::State change with StateStackEntry (#3485)
Shortens a common `PushState` pattern
This commit is contained in:
@@ -8,9 +8,7 @@ namespace Carbon::Parse {
|
||||
|
||||
auto HandleCallExpr(Context& context) -> void {
|
||||
auto state = context.PopState();
|
||||
|
||||
state.state = State::CallExprFinish;
|
||||
context.PushState(state);
|
||||
context.PushState(state, State::CallExprFinish);
|
||||
|
||||
context.AddNode(NodeKind::CallExprStart, context.Consume(),
|
||||
state.subtree_start, state.has_error);
|
||||
|
||||
Reference in New Issue
Block a user