mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +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
@@ -23,7 +23,7 @@ static auto NoteAssociatedFunction(Context& context,
|
||||
Context::DiagnosticBuilder& builder,
|
||||
SemIR::FunctionId function_id) -> void {
|
||||
CARBON_DIAGNOSTIC(ImplAssociatedFunctionHere, Note,
|
||||
"Associated function {0} declared here.", SemIR::NameId);
|
||||
"associated function {0} declared here", SemIR::NameId);
|
||||
const auto& function = context.functions().Get(function_id);
|
||||
builder.Note(function.latest_decl_id(), ImplAssociatedFunctionHere,
|
||||
function.name_id);
|
||||
@@ -86,7 +86,7 @@ static auto CheckAssociatedFunctionImplementation(
|
||||
context.insts().TryGetAs<SemIR::FunctionDecl>(impl_decl_id);
|
||||
if (!impl_function_decl) {
|
||||
CARBON_DIAGNOSTIC(ImplFunctionWithNonFunction, Error,
|
||||
"Associated function {0} implemented by non-function.",
|
||||
"associated function {0} implemented by non-function",
|
||||
SemIR::NameId);
|
||||
auto builder = context.emitter().Build(
|
||||
impl_decl_id, ImplFunctionWithNonFunction,
|
||||
@@ -130,7 +130,7 @@ static auto BuildInterfaceWitness(
|
||||
const auto& interface = context.interfaces().Get(interface_type.interface_id);
|
||||
if (!context.TryToDefineType(interface_type_id, [&] {
|
||||
CARBON_DIAGNOSTIC(ImplOfUndefinedInterface, Error,
|
||||
"Implementation of undefined interface {0}.",
|
||||
"implementation of undefined interface {0}",
|
||||
SemIR::NameId);
|
||||
return context.emitter().Build(
|
||||
impl.definition_id, ImplOfUndefinedInterface, interface.name_id);
|
||||
@@ -172,7 +172,7 @@ static auto BuildInterfaceWitness(
|
||||
} else {
|
||||
CARBON_DIAGNOSTIC(
|
||||
ImplMissingFunction, Error,
|
||||
"Missing implementation of {0} in impl of interface {1}.",
|
||||
"missing implementation of {0} in impl of interface {1}",
|
||||
SemIR::NameId, SemIR::NameId);
|
||||
auto builder =
|
||||
context.emitter().Build(impl.definition_id, ImplMissingFunction,
|
||||
|
||||
Reference in New Issue
Block a user