mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Add PushState overload to combine Parse::State change with StateStackEntry (#3485)
Shortens a common `PushState` pattern
This commit is contained in:
@@ -85,8 +85,7 @@ static auto ApplyIntroducer(Context& context, Context::StateStackEntry state,
|
||||
context.ReplacePlaceholderNode(state.subtree_start, introducer_kind,
|
||||
context.Consume());
|
||||
// Reuse state here to retain its `subtree_start`.
|
||||
state.state = next_state;
|
||||
context.PushState(state);
|
||||
context.PushState(state, next_state);
|
||||
}
|
||||
|
||||
// Handles `base` as a declaration.
|
||||
|
||||
Reference in New Issue
Block a user