mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-03 22:02:51 +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
@@ -73,7 +73,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
|
||||
!context.node_stack().PeekIs<Parse::NodeKind::ImplicitParamListStart>()) {
|
||||
CARBON_DIAGNOSTIC(
|
||||
SelfOutsideImplicitParamList, Error,
|
||||
"`self` can only be declared in an implicit parameter list.");
|
||||
"`self` can only be declared in an implicit parameter list");
|
||||
context.emitter().Emit(node_id, SelfOutsideImplicitParamList);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
|
||||
if (is_generic) {
|
||||
CARBON_DIAGNOSTIC(
|
||||
CompileTimeBindingInVarDecl, Error,
|
||||
"`var` declaration cannot declare a compile-time binding.");
|
||||
"`var` declaration cannot declare a compile-time binding");
|
||||
context.emitter().Emit(type_node, CompileTimeBindingInVarDecl);
|
||||
}
|
||||
auto binding_id =
|
||||
@@ -99,7 +99,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
|
||||
auto parent_class_decl = context.GetCurrentScopeAs<SemIR::ClassDecl>();
|
||||
cast_type_id = context.AsCompleteType(cast_type_id, [&] {
|
||||
CARBON_DIAGNOSTIC(IncompleteTypeInVarDecl, Error,
|
||||
"{0} has incomplete type `{1}`.", llvm::StringLiteral,
|
||||
"{0} has incomplete type `{1}`", llvm::StringLiteral,
|
||||
SemIR::TypeId);
|
||||
return context.emitter().Build(type_node, IncompleteTypeInVarDecl,
|
||||
parent_class_decl
|
||||
@@ -171,7 +171,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
|
||||
case Parse::NodeKind::LetIntroducer: {
|
||||
cast_type_id = context.AsCompleteType(cast_type_id, [&] {
|
||||
CARBON_DIAGNOSTIC(IncompleteTypeInLetDecl, Error,
|
||||
"`let` binding has incomplete type `{0}`.",
|
||||
"`let` binding has incomplete type `{0}`",
|
||||
SemIR::TypeId);
|
||||
return context.emitter().Build(type_node, IncompleteTypeInLetDecl,
|
||||
cast_type_id);
|
||||
@@ -216,7 +216,7 @@ auto HandleParseNode(Context& context, Parse::AddrId node_id) -> bool {
|
||||
node_id, {.type_id = self_param->type_id, .inner_id = self_param_id});
|
||||
} else {
|
||||
CARBON_DIAGNOSTIC(AddrOnNonSelfParam, Error,
|
||||
"`addr` can only be applied to a `self` parameter.");
|
||||
"`addr` can only be applied to a `self` parameter");
|
||||
context.emitter().Emit(TokenOnly(node_id), AddrOnNonSelfParam);
|
||||
context.node_stack().Push(node_id, self_param_id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user