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:
Jon Ross-Perkins
2024-09-19 21:32:53 +00:00
committed by GitHub
co-authored by Richard Smith
parent 7f6d684b29
commit e7aebbe581
578 changed files with 2166 additions and 2173 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_comma_only.carbon
// CHECK:STDERR: fail_comma_only.carbon:[[@LINE+3]]:9: ERROR: Expected `.field: field_type` or `.field = value`.
// CHECK:STDERR: fail_comma_only.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value`
// CHECK:STDERR: var x: {,} = {};
// CHECK:STDERR: ^
var x: {,} = {};
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon
// CHECK:STDERR: fail_comma_repeat_in_type.carbon:[[@LINE+3]]:17: ERROR: Expected `.field: field_type`.
// CHECK:STDERR: fail_comma_repeat_in_type.carbon:[[@LINE+3]]:17: error: expected `.field: field_type`
// CHECK:STDERR: var x: {.a: i32,,} = {};
// CHECK:STDERR: ^
var x: {.a: i32,,} = {};
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon
// CHECK:STDERR: fail_comma_repeat_in_value.carbon:[[@LINE+3]]:16: ERROR: Expected `.field = value`.
// CHECK:STDERR: fail_comma_repeat_in_value.carbon:[[@LINE+3]]:16: error: expected `.field = value`
// CHECK:STDERR: var x: {.a = 0,,} = {};
// CHECK:STDERR: ^
var x: {.a = 0,,} = {};
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon
// CHECK:STDERR: fail_extra_token_in_type.carbon:[[@LINE+3]]:17: ERROR: Expected `,` or `}`.
// CHECK:STDERR: fail_extra_token_in_type.carbon:[[@LINE+3]]:17: error: expected `,` or `}`
// CHECK:STDERR: var x: {.a: i32 banana} = {.a = 0};
// CHECK:STDERR: ^~~~~~
var x: {.a: i32 banana} = {.a = 0};
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon
// CHECK:STDERR: fail_extra_token_in_value.carbon:[[@LINE+3]]:28: ERROR: Expected `,` or `}`.
// CHECK:STDERR: fail_extra_token_in_value.carbon:[[@LINE+3]]:28: error: expected `,` or `}`
// CHECK:STDERR: var x: {.a: i32} = {.a = 0 banana};
// CHECK:STDERR: ^~~~~~
var x: {.a: i32} = {.a = 0 banana};
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_identifier_colon.carbon
// CHECK:STDERR: fail_identifier_colon.carbon:[[@LINE+3]]:9: ERROR: Expected `.field: field_type` or `.field = value`.
// CHECK:STDERR: fail_identifier_colon.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value`
// CHECK:STDERR: var x: {a:} = {};
// CHECK:STDERR: ^
var x: {a:} = {};
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_identifier_equals.carbon
// CHECK:STDERR: fail_identifier_equals.carbon:[[@LINE+3]]:9: ERROR: Expected `.field: field_type` or `.field = value`.
// CHECK:STDERR: fail_identifier_equals.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value`
// CHECK:STDERR: var x: {a=} = {};
// CHECK:STDERR: ^
var x: {a=} = {};
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_identifier_only.carbon
// CHECK:STDERR: fail_identifier_only.carbon:[[@LINE+3]]:9: ERROR: Expected `.field: field_type` or `.field = value`.
// CHECK:STDERR: fail_identifier_only.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value`
// CHECK:STDERR: var x: {a} = {};
// CHECK:STDERR: ^
var x: {a} = {};
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_invalid_struct_designator.carbon
// CHECK:STDERR: fail_invalid_struct_designator.carbon:[[@LINE+3]]:16: ERROR: Expected identifier after `.`.
// CHECK:STDERR: fail_invalid_struct_designator.carbon:[[@LINE+3]]:16: error: expected identifier after `.`
// CHECK:STDERR: var x: i32 = {.7 = 8};
// CHECK:STDERR: ^
var x: i32 = {.7 = 8};
+1 -1
View File
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_missing_type.carbon
// CHECK:STDERR: fail_missing_type.carbon:[[@LINE+3]]:12: ERROR: Expected expression.
// CHECK:STDERR: fail_missing_type.carbon:[[@LINE+3]]:12: error: expected expression
// CHECK:STDERR: var x: {.a:} = {};
// CHECK:STDERR: ^
var x: {.a:} = {};
+1 -1
View File
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_missing_value.carbon
// CHECK:STDERR: fail_missing_value.carbon:[[@LINE+3]]:12: ERROR: Expected expression.
// CHECK:STDERR: fail_missing_value.carbon:[[@LINE+3]]:12: error: expected expression
// CHECK:STDERR: var x: {.a=} = {};
// CHECK:STDERR: ^
var x: {.a=} = {};
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon
// CHECK:STDERR: fail_mix_type_and_value.carbon:[[@LINE+3]]:21: ERROR: Expected `.field: field_type`.
// CHECK:STDERR: fail_mix_type_and_value.carbon:[[@LINE+3]]:21: error: expected `.field: field_type`
// CHECK:STDERR: var x: {.a: i32, .b = 0} = {};
// CHECK:STDERR: ^
var x: {.a: i32, .b = 0} = {};
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon
// CHECK:STDERR: fail_mix_value_and_type.carbon:[[@LINE+3]]:17: ERROR: Expected `.field = value`.
// CHECK:STDERR: fail_mix_value_and_type.carbon:[[@LINE+3]]:17: error: expected `.field = value`
// CHECK:STDERR: var x: {.a = 0, b: i32} = {};
// CHECK:STDERR: ^
var x: {.a = 0, b: i32} = {};
@@ -8,21 +8,21 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon
// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+8]]:25: ERROR: Expected `.field = value`.
// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+8]]:25: error: expected `.field = value`
// CHECK:STDERR: var x: i32 = {.a = 1, .b, .c: i32};
// CHECK:STDERR: ^
// CHECK:STDERR:
// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+4]]:29: ERROR: Expected `.field = value`.
// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+4]]:29: error: expected `.field = value`
// CHECK:STDERR: var x: i32 = {.a = 1, .b, .c: i32};
// CHECK:STDERR: ^
// CHECK:STDERR:
var x: i32 = {.a = 1, .b, .c: i32};
// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+7]]:26: ERROR: Expected `.field: field_type`.
// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+7]]:26: error: expected `.field: field_type`
// CHECK:STDERR: var x: i32 = {.a: i32, .b, .c = 1};
// CHECK:STDERR: ^
// CHECK:STDERR:
// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+3]]:31: ERROR: Expected `.field: field_type`.
// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+3]]:31: error: expected `.field: field_type`
// CHECK:STDERR: var x: i32 = {.a: i32, .b, .c = 1};
// CHECK:STDERR: ^
var x: i32 = {.a: i32, .b, .c = 1};
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon
// CHECK:STDERR: fail_no_colon_or_equals.carbon:[[@LINE+3]]:11: ERROR: Expected `.field: field_type` or `.field = value`.
// CHECK:STDERR: fail_no_colon_or_equals.carbon:[[@LINE+3]]:11: error: expected `.field: field_type` or `.field = value`
// CHECK:STDERR: var x: {.a} = {};
// CHECK:STDERR: ^
var x: {.a} = {};
+1 -1
View File
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_period_only.carbon
// CHECK:STDERR: fail_period_only.carbon:[[@LINE+3]]:10: ERROR: Expected identifier after `.`.
// CHECK:STDERR: fail_period_only.carbon:[[@LINE+3]]:10: error: expected identifier after `.`
// CHECK:STDERR: var x: {.} = {};
// CHECK:STDERR: ^
var x: {.} = {};
+1 -1
View File
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_period_paren.carbon
// CHECK:STDERR: fail_period_paren.carbon:[[@LINE+3]]:10: ERROR: Expected identifier after `.`.
// CHECK:STDERR: fail_period_paren.carbon:[[@LINE+3]]:10: error: expected identifier after `.`
// CHECK:STDERR: var x: {.(a) = 1};
// CHECK:STDERR: ^
var x: {.(a) = 1};
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_period_string_colon.carbon
// CHECK:STDERR: fail_period_string_colon.carbon:[[@LINE+3]]:10: ERROR: Expected identifier after `.`.
// CHECK:STDERR: fail_period_string_colon.carbon:[[@LINE+3]]:10: error: expected identifier after `.`
// CHECK:STDERR: var x: {."hello": i32, .y: i32} = {};
// CHECK:STDERR: ^~~~~~~
var x: {."hello": i32, .y: i32} = {};
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_period_string_equals.carbon
// CHECK:STDERR: fail_period_string_equals.carbon:[[@LINE+3]]:10: ERROR: Expected identifier after `.`.
// CHECK:STDERR: fail_period_string_equals.carbon:[[@LINE+3]]:10: error: expected identifier after `.`
// CHECK:STDERR: var x: {."hello" = 0, .y = 4} = {};
// CHECK:STDERR: ^~~~~~~
var x: {."hello" = 0, .y = 4} = {};
@@ -8,7 +8,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_type_no_designator.carbon
// CHECK:STDERR: fail_type_no_designator.carbon:[[@LINE+3]]:9: ERROR: Expected `.field: field_type` or `.field = value`.
// CHECK:STDERR: fail_type_no_designator.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value`
// CHECK:STDERR: var x: {i32} = {};
// CHECK:STDERR: ^~~
var x: {i32} = {};