Convert TokenInfo::ResetAs... functions to return new TokenInfos. (#7252)

As requested in #7249.
This commit is contained in:
Richard Smith
2026-05-23 01:22:22 +00:00
committed by GitHub
parent 49024c8d83
commit 52b45a66a3
3 changed files with 14 additions and 18 deletions
+2 -3
View File
@@ -212,9 +212,8 @@ auto TokenizedBuffer::AddPostLexingRecoveryTokenAsIdentifier(TokenIndex token)
CARBON_CHECK(kind != TokenKind::Identifier, "Recovery not required");
auto identifier_id = value_stores_->identifiers().Add(GetTokenText(token));
auto info = token_infos_.Get(token);
info.ResetAsErrorRecoveryIdentifier(identifier_id);
return AddPostLexingRecoveryToken(info);
return AddPostLexingRecoveryToken(
token_infos_.Get(token).AsErrorRecoveryIdentifier(identifier_id));
}
auto TokenizedBuffer::AddPostLexingRecoveryToken(TokenInfo info) -> TokenIndex {