Drop redundant parameter from ConsumeAndAddCloseSymbol (#6724)

This commit is contained in:
Geoff Romer
2026-02-12 01:56:15 +00:00
committed by GitHub
parent 320096da67
commit 3719d200d6
7 changed files with 16 additions and 21 deletions
+3 -4
View File
@@ -68,10 +68,9 @@ auto Context::ConsumeAndAddOpenParen(Lex::TokenIndex default_token,
}
}
auto Context::ConsumeAndAddCloseSymbol(Lex::TokenIndex expected_open,
State state, NodeKind close_kind)
auto Context::ConsumeAndAddCloseSymbol(State state, NodeKind close_kind)
-> void {
Lex::TokenKind open_token_kind = tokens().GetKind(expected_open);
Lex::TokenKind open_token_kind = tokens().GetKind(state.token);
if (!open_token_kind.is_opening_symbol()) {
AddNode(close_kind, state.token, /*has_error=*/true);
@@ -85,7 +84,7 @@ auto Context::ConsumeAndAddCloseSymbol(Lex::TokenIndex expected_open,
emitter_.Emit(*position_, ExpectedCloseSymbol,
open_token_kind.closing_symbol());
SkipTo(tokens().GetMatchedClosingToken(expected_open));
SkipTo(tokens().GetMatchedClosingToken(state.token));
AddNode(close_kind, Consume(), /*has_error=*/true);
}
}