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
@@ -10,7 +10,7 @@
fn Negate(n: i32) -> i32 = "int.snegate";
// CHECK:STDERR: fail_bound_negative.carbon:[[@LINE+3]]:14: ERROR: Array bound of -1 is negative.
// CHECK:STDERR: fail_bound_negative.carbon:[[@LINE+3]]:14: error: array bound of -1 is negative
// CHECK:STDERR: var a: [i32; Negate(1)];
// CHECK:STDERR: ^~~~~~~
var a: [i32; Negate(1)];
+4 -4
View File
@@ -11,20 +11,20 @@
// TODO: Once we preserve the full value of integer literals in SemIR, check
// that we reject the array bound being too large.
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+4]]:14: ERROR: Integer literal with value 39999999999999999993 does not fit in i32.
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+4]]:14: error: integer literal with value 39999999999999999993 does not fit in i32
// CHECK:STDERR: var a: [i32; 39999999999999999993];
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
var a: [i32; 39999999999999999993];
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+10]]:9: ERROR: Cannot implicitly convert from `i32` to `type`.
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+10]]:9: error: cannot implicitly convert from `i32` to `type`
// CHECK:STDERR: var b: [1; 39999999999999999993];
// CHECK:STDERR: ^
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+7]]:9: Type `i32` does not implement interface `ImplicitAs`.
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+7]]:9: type `i32` does not implement interface `ImplicitAs`
// CHECK:STDERR: var b: [1; 39999999999999999993];
// CHECK:STDERR: ^
// CHECK:STDERR:
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+3]]:12: ERROR: Integer literal with value 39999999999999999993 does not fit in i32.
// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+3]]:12: error: integer literal with value 39999999999999999993 does not fit in i32
// CHECK:STDERR: var b: [1; 39999999999999999993];
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
var b: [1; 39999999999999999993];
@@ -10,10 +10,10 @@
class Incomplete;
// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE+6]]:8: ERROR: Variable has incomplete type `[Incomplete; 1]`.
// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE+6]]:8: error: Variable has incomplete type `[Incomplete; 1]`
// CHECK:STDERR: var a: [Incomplete; 1];
// CHECK:STDERR: ^~~~~~~~~~~~~~~
// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE-5]]:1: Class was forward declared here.
// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE-5]]:1: class was forward declared here
// CHECK:STDERR: class Incomplete;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
var a: [Incomplete; 1];
+2 -2
View File
@@ -8,10 +8,10 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_invalid_type.carbon
// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+6]]:9: ERROR: Cannot implicitly convert from `i32` to `type`.
// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+6]]:9: error: cannot implicitly convert from `i32` to `type`
// CHECK:STDERR: var a: [1; 1];
// CHECK:STDERR: ^
// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+3]]:9: Type `i32` does not implement interface `ImplicitAs`.
// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+3]]:9: type `i32` does not implement interface `ImplicitAs`
// CHECK:STDERR: var a: [1; 1];
// CHECK:STDERR: ^
var a: [1; 1];
+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/check/testdata/array/fail_out_of_bound.carbon
// CHECK:STDERR: fail_out_of_bound.carbon:[[@LINE+3]]:19: ERROR: Cannot initialize array of 1 element(s) from 3 initializer(s).
// CHECK:STDERR: fail_out_of_bound.carbon:[[@LINE+3]]:19: error: cannot initialize array of 1 element(s) from 3 initializer(s)
// CHECK:STDERR: var a: [i32; 1] = (1, 2, 3);
// CHECK:STDERR: ^~~~~~~~~
var a: [i32; 1] = (1, 2, 3);
@@ -9,7 +9,7 @@
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon
var a: [i32; 3] = (1, 2, 3);
// CHECK:STDERR: fail_out_of_bound_non_literal.carbon:[[@LINE+3]]:16: ERROR: Array index `3` is past the end of type `[i32; 3]`.
// CHECK:STDERR: fail_out_of_bound_non_literal.carbon:[[@LINE+3]]:16: error: array index `3` is past the end of type `[i32; 3]`
// CHECK:STDERR: var b: i32 = a[{.index = 3}.index];
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
var b: i32 = a[{.index = 3}.index];
+6 -6
View File
@@ -8,33 +8,33 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_type_mismatch.carbon
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: ERROR: Cannot implicitly convert from `String` to `i32`.
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error: cannot implicitly convert from `String` to `i32`
// CHECK:STDERR: var a: [i32; 3] = (1, "Hello", "World");
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: Type `String` does not implement interface `ImplicitAs`.
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: type `String` does not implement interface `ImplicitAs`
// CHECK:STDERR: var a: [i32; 3] = (1, "Hello", "World");
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
var a: [i32; 3] = (1, "Hello", "World");
var t1: (i32, String, String);
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: ERROR: Cannot implicitly convert from `String` to `i32`.
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error: cannot implicitly convert from `String` to `i32`
// CHECK:STDERR: var b: [i32; 3] = t1;
// CHECK:STDERR: ^~
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: Type `String` does not implement interface `ImplicitAs`.
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: type `String` does not implement interface `ImplicitAs`
// CHECK:STDERR: var b: [i32; 3] = t1;
// CHECK:STDERR: ^~
// CHECK:STDERR:
var b: [i32; 3] = t1;
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: ERROR: Cannot initialize array of 3 element(s) from 2 initializer(s).
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: error: cannot initialize array of 3 element(s) from 2 initializer(s)
// CHECK:STDERR: var c: [i32; 3] = (1, 2);
// CHECK:STDERR: ^~~~~~
// CHECK:STDERR:
var c: [i32; 3] = (1, 2);
var t2: (i32, i32);
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:19: ERROR: Cannot initialize array of 3 element(s) from tuple with 2 element(s).
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:19: error: cannot initialize array of 3 element(s) from tuple with 2 element(s).
// CHECK:STDERR: var d: [i32; 3] = t2;
// CHECK:STDERR: ^~
var d: [i32; 3] = t2;
+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/check/testdata/array/fail_undefined_bound.carbon
// CHECK:STDERR: fail_undefined_bound.carbon:[[@LINE+3]]:8: ERROR: Semantics TODO: `HandleArrayExprWithoutBounds`.
// CHECK:STDERR: fail_undefined_bound.carbon:[[@LINE+3]]:8: error: semantics TODO: `HandleArrayExprWithoutBounds`
// CHECK:STDERR: var a: [i32; ];
// CHECK:STDERR: ^~~~~~~
var a: [i32; ];