mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Drop redundant parameter from ConsumeAndAddCloseSymbol (#6724)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user