mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Rename functions which only print a diagnostic to Diagnose* (#3886)
This is something I noticed working on https://github.com/carbon-language/carbon-lang/pull/3884; I think we have more functions named Diagnose* at present than Emit* or Report*, so just trying to consolidate. Note a couple Diagnose* functions do a little more validation, but maybe those should actually be renamed away (zygoloid had mentioned wanting to generally split out diagnostics to their own function, and then we'd have it be a more common pattern).
This commit is contained in:
@@ -412,13 +412,13 @@ auto Context::RecoverFromDeclError(StateStackEntry state, NodeKind node_kind,
|
||||
/*has_error=*/true);
|
||||
}
|
||||
|
||||
auto Context::EmitExpectedDeclSemi(Lex::TokenKind expected_kind) -> void {
|
||||
auto Context::DiagnoseExpectedDeclSemi(Lex::TokenKind expected_kind) -> void {
|
||||
CARBON_DIAGNOSTIC(ExpectedDeclSemi, Error,
|
||||
"`{0}` declarations must end with a `;`.", Lex::TokenKind);
|
||||
emitter().Emit(*position(), ExpectedDeclSemi, expected_kind);
|
||||
}
|
||||
|
||||
auto Context::EmitExpectedDeclSemiOrDefinition(Lex::TokenKind expected_kind)
|
||||
auto Context::DiagnoseExpectedDeclSemiOrDefinition(Lex::TokenKind expected_kind)
|
||||
-> void {
|
||||
CARBON_DIAGNOSTIC(ExpectedDeclSemiOrDefinition, Error,
|
||||
"`{0}` declarations must either end with a `;` or "
|
||||
|
||||
Reference in New Issue
Block a user