mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 19:31:08 +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
@@ -9,12 +9,12 @@
|
||||
|
||||
namespace Carbon::Check {
|
||||
|
||||
CARBON_DIAGNOSTIC(ModifierPrevious, Note, "`{0}` previously appeared here.",
|
||||
CARBON_DIAGNOSTIC(ModifierPrevious, Note, "`{0}` previously appeared here",
|
||||
Lex::TokenKind);
|
||||
|
||||
static auto DiagnoseRepeated(Context& context, Parse::NodeId first_node,
|
||||
Parse::NodeId second_node) -> void {
|
||||
CARBON_DIAGNOSTIC(ModifierRepeated, Error, "`{0}` repeated on declaration.",
|
||||
CARBON_DIAGNOSTIC(ModifierRepeated, Error, "`{0}` repeated on declaration",
|
||||
Lex::TokenKind);
|
||||
context.emitter()
|
||||
.Build(second_node, ModifierRepeated, context.token_kind(second_node))
|
||||
@@ -25,7 +25,7 @@ static auto DiagnoseRepeated(Context& context, Parse::NodeId first_node,
|
||||
static auto DiagnoseNotAllowedWith(Context& context, Parse::NodeId first_node,
|
||||
Parse::NodeId second_node) -> void {
|
||||
CARBON_DIAGNOSTIC(ModifierNotAllowedWith, Error,
|
||||
"`{0}` not allowed on declaration with `{1}`.",
|
||||
"`{0}` not allowed on declaration with `{1}`",
|
||||
Lex::TokenKind, Lex::TokenKind);
|
||||
context.emitter()
|
||||
.Build(second_node, ModifierNotAllowedWith,
|
||||
@@ -79,7 +79,7 @@ static auto HandleModifier(Context& context, Parse::NodeId node_id,
|
||||
CARBON_CHECK(closest_later_modifier.is_valid());
|
||||
|
||||
CARBON_DIAGNOSTIC(ModifierMustAppearBefore, Error,
|
||||
"`{0}` must appear before `{1}`.", Lex::TokenKind,
|
||||
"`{0}` must appear before `{1}`", Lex::TokenKind,
|
||||
Lex::TokenKind);
|
||||
context.emitter()
|
||||
.Build(node_id, ModifierMustAppearBefore, context.token_kind(node_id),
|
||||
|
||||
Reference in New Issue
Block a user