mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Update basic diagnostic capitalization/punctuation (#4328)
This is a primarily automated change:
- Search & replace for capitalization
-
`(CARBON_DIAGNOSTIC\((?:\n\s+)?\w+,(?:\n\s+)?\s\w+,(?:\n\s+)?\s")([A-Z])`
- `$1\L$2`
- Search & replace for period
-
`(CARBON_DIAGNOSTIC\((?:\n\s+)?\w+,(?:\n\s+)?\s\w+,(?:\n\s+)?\s"(?:[^)]|\n)+)\.("[,)])`
- `$1$2`
- Limited search & replace for `ERROR: ` -> `error: ` in streamed things
- Leaving a TODO for command_line because there's more cleanup that can
be done there
- Modify diagnostic_consumer.cpp
- ERROR -> error
- WARNING -> warning
---------
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Richard Smith
parent
7f6d684b29
commit
e7aebbe581
@@ -34,11 +34,11 @@ auto CheckFunctionTypeMatches(Context& context,
|
||||
prev_return_type_id)) {
|
||||
CARBON_DIAGNOSTIC(
|
||||
FunctionRedeclReturnTypeDiffers, Error,
|
||||
"Function redeclaration differs because return type is `{0}`.",
|
||||
"function redeclaration differs because return type is `{0}`",
|
||||
SemIR::TypeId);
|
||||
CARBON_DIAGNOSTIC(
|
||||
FunctionRedeclReturnTypeDiffersNoReturn, Error,
|
||||
"Function redeclaration differs because no return type is provided.");
|
||||
"function redeclaration differs because no return type is provided");
|
||||
auto diag =
|
||||
new_return_type_id.is_valid()
|
||||
? context.emitter().Build(new_function.latest_decl_id(),
|
||||
@@ -48,13 +48,13 @@ auto CheckFunctionTypeMatches(Context& context,
|
||||
FunctionRedeclReturnTypeDiffersNoReturn);
|
||||
if (prev_return_type_id.is_valid()) {
|
||||
CARBON_DIAGNOSTIC(FunctionRedeclReturnTypePrevious, Note,
|
||||
"Previously declared with return type `{0}`.",
|
||||
"previously declared with return type `{0}`",
|
||||
SemIR::TypeId);
|
||||
diag.Note(prev_function.latest_decl_id(),
|
||||
FunctionRedeclReturnTypePrevious, prev_return_type_id);
|
||||
} else {
|
||||
CARBON_DIAGNOSTIC(FunctionRedeclReturnTypePreviousNoReturn, Note,
|
||||
"Previously declared with no return type.");
|
||||
"previously declared with no return type");
|
||||
diag.Note(prev_function.latest_decl_id(),
|
||||
FunctionRedeclReturnTypePreviousNoReturn);
|
||||
}
|
||||
@@ -77,7 +77,7 @@ auto CheckFunctionReturnType(Context& context, SemIRLoc loc,
|
||||
if (return_info.init_repr.kind == SemIR::InitRepr::Incomplete) {
|
||||
auto diagnose_incomplete_return_type = [&] {
|
||||
CARBON_DIAGNOSTIC(IncompleteTypeInFunctionReturnType, Error,
|
||||
"Function returns incomplete type `{0}`.",
|
||||
"function returns incomplete type `{0}`",
|
||||
SemIR::TypeId);
|
||||
return context.emitter().Build(loc, IncompleteTypeInFunctionReturnType,
|
||||
return_info.type_id);
|
||||
|
||||
Reference in New Issue
Block a user