mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +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:
@@ -64,7 +64,7 @@ auto HandleFunctionSignatureFinish(Context& context) -> void {
|
||||
}
|
||||
auto semi = context.ConsumeIf(Lex::TokenKind::Semi);
|
||||
if (!semi && !state.has_error) {
|
||||
context.EmitExpectedDeclSemi(context.tokens().GetKind(state.token));
|
||||
context.DiagnoseExpectedDeclSemi(context.tokens().GetKind(state.token));
|
||||
state.has_error = true;
|
||||
}
|
||||
if (state.has_error) {
|
||||
@@ -78,7 +78,7 @@ auto HandleFunctionSignatureFinish(Context& context) -> void {
|
||||
}
|
||||
default: {
|
||||
if (!state.has_error) {
|
||||
context.EmitExpectedDeclSemiOrDefinition(Lex::TokenKind::Fn);
|
||||
context.DiagnoseExpectedDeclSemiOrDefinition(Lex::TokenKind::Fn);
|
||||
}
|
||||
// Only need to skip if we've not already found a new line.
|
||||
bool skip_past_likely_end =
|
||||
|
||||
Reference in New Issue
Block a user