mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +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,7 +9,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/fail_not_callable.carbon
|
||||
|
||||
fn Run() {
|
||||
// CHECK:STDERR: fail_not_callable.carbon:[[@LINE+3]]:16: ERROR: Value of type `String` is not callable.
|
||||
// CHECK:STDERR: fail_not_callable.carbon:[[@LINE+3]]:16: error: value of type `String` is not callable
|
||||
// CHECK:STDERR: var x: i32 = "hello"();
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
var x: i32 = "hello"();
|
||||
|
||||
+12
-12
@@ -13,52 +13,52 @@ fn Run1(a: i32) {}
|
||||
fn Run2(a: i32, b: i32) {}
|
||||
|
||||
fn Main() {
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: ERROR: 1 argument(s) passed to function expecting 0 argument(s).
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 1 argument(s) passed to function expecting 0 argument(s).
|
||||
// CHECK:STDERR: Run0(1);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-8]]:1: Calling function declared here.
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-8]]:1: calling function declared here
|
||||
// CHECK:STDERR: fn Run0() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
Run0(1);
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: ERROR: 2 argument(s) passed to function expecting 0 argument(s).
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 2 argument(s) passed to function expecting 0 argument(s).
|
||||
// CHECK:STDERR: Run0(0, 1);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-16]]:1: Calling function declared here.
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-16]]:1: calling function declared here
|
||||
// CHECK:STDERR: fn Run0() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
Run0(0, 1);
|
||||
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: ERROR: 0 argument(s) passed to function expecting 1 argument(s).
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 0 argument(s) passed to function expecting 1 argument(s).
|
||||
// CHECK:STDERR: Run1();
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-24]]:1: Calling function declared here.
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-24]]:1: calling function declared here
|
||||
// CHECK:STDERR: fn Run1(a: i32) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
Run1();
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: ERROR: 2 argument(s) passed to function expecting 1 argument(s).
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 2 argument(s) passed to function expecting 1 argument(s).
|
||||
// CHECK:STDERR: Run1(0, 1);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-32]]:1: Calling function declared here.
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-32]]:1: calling function declared here
|
||||
// CHECK:STDERR: fn Run1(a: i32) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
Run1(0, 1);
|
||||
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: ERROR: 0 argument(s) passed to function expecting 2 argument(s).
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 0 argument(s) passed to function expecting 2 argument(s).
|
||||
// CHECK:STDERR: Run2();
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-40]]:1: Calling function declared here.
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-40]]:1: calling function declared here
|
||||
// CHECK:STDERR: fn Run2(a: i32, b: i32) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
Run2();
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:3: ERROR: 1 argument(s) passed to function expecting 2 argument(s).
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:3: error: 1 argument(s) passed to function expecting 2 argument(s).
|
||||
// CHECK:STDERR: Run2(0);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-48]]:1: Calling function declared here.
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-48]]:1: calling function declared here
|
||||
// CHECK:STDERR: fn Run2(a: i32, b: i32) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Run2(0);
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
fn G(a: i32) {}
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_param_type.carbon:[[@LINE+9]]:3: ERROR: Cannot implicitly convert from `f64` to `i32`.
|
||||
// CHECK:STDERR: fail_param_type.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `f64` to `i32`
|
||||
// CHECK:STDERR: G(1.0);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_param_type.carbon:[[@LINE+6]]:3: Type `f64` does not implement interface `ImplicitAs`.
|
||||
// CHECK:STDERR: fail_param_type.carbon:[[@LINE+6]]:3: type `f64` does not implement interface `ImplicitAs`
|
||||
// CHECK:STDERR: G(1.0);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_param_type.carbon:[[@LINE-9]]:1: Initializing parameter 1 of function declared here.
|
||||
// CHECK:STDERR: fail_param_type.carbon:[[@LINE-9]]:1: initializing parameter 1 of function declared here
|
||||
// CHECK:STDERR: fn G(a: i32) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
G(1.0);
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
fn Foo() -> f64 { return 1.0; }
|
||||
|
||||
fn Run() {
|
||||
// CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+6]]:3: ERROR: Cannot implicitly convert from `f64` to `i32`.
|
||||
// CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `f64` to `i32`
|
||||
// CHECK:STDERR: var x: i32 = Foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+3]]:3: Type `f64` does not implement interface `ImplicitAs`.
|
||||
// CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+3]]:3: type `f64` does not implement interface `ImplicitAs`
|
||||
// CHECK:STDERR: var x: i32 = Foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
var x: i32 = Foo();
|
||||
|
||||
Reference in New Issue
Block a user