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
@@ -10,20 +10,20 @@
|
||||
|
||||
// This is a valid parse tree even though the lex errors.
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+4]]:11: ERROR: Opening symbol without a corresponding closing symbol.
|
||||
// CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+4]]:11: error: opening symbol without a corresponding closing symbol
|
||||
// CHECK:STDERR: var x: ([i32; 3) = (0, 1, 2);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var x: ([i32; 3) = (0, 1, 2);
|
||||
// CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+11]]:15: ERROR: Opening symbol without a corresponding closing symbol.
|
||||
// CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+11]]:15: error: opening symbol without a corresponding closing symbol
|
||||
// CHECK:STDERR: var x: {.y: (} = {.y = ((};
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+7]]:26: ERROR: Opening symbol without a corresponding closing symbol.
|
||||
// CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+7]]:26: error: opening symbol without a corresponding closing symbol
|
||||
// CHECK:STDERR: var x: {.y: (} = {.y = ((};
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+3]]:27: ERROR: Opening symbol without a corresponding closing symbol.
|
||||
// CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+3]]:27: error: opening symbol without a corresponding closing symbol
|
||||
// CHECK:STDERR: var x: {.y: (} = {.y = ((};
|
||||
// CHECK:STDERR: ^
|
||||
var x: {.y: (} = {.y = ((};
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
|
||||
// NOTE: Move to its own directory when more tests are added.
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+4]]:5: ERROR: Expected identifier after `.`.
|
||||
// CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+4]]:5: error: expected identifier after `.`
|
||||
// CHECK:STDERR: a.;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
a.;
|
||||
// CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+3]]:5: ERROR: Expected identifier after `.`.
|
||||
// CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+3]]:5: error: expected identifier after `.`
|
||||
// CHECK:STDERR: a.fn;
|
||||
// CHECK:STDERR: ^~
|
||||
a.fn;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_modifiers_before_semi.carbon
|
||||
|
||||
// CHECK:STDERR: fail_modifiers_before_semi.carbon:[[@LINE+3]]:18: ERROR: Unrecognized declaration introducer.
|
||||
// CHECK:STDERR: fail_modifiers_before_semi.carbon:[[@LINE+3]]:18: error: unrecognized declaration introducer
|
||||
// CHECK:STDERR: protected virtual;
|
||||
// CHECK:STDERR: ^
|
||||
protected virtual;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon
|
||||
|
||||
// CHECK:STDERR: fail_no_intro_with_semi.carbon:[[@LINE+3]]:1: ERROR: Unrecognized declaration introducer.
|
||||
// CHECK:STDERR: fail_no_intro_with_semi.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer
|
||||
// CHECK:STDERR: foo;
|
||||
// CHECK:STDERR: ^~~
|
||||
foo;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon
|
||||
|
||||
// CHECK:STDERR: fail_no_intro_without_semi.carbon:[[@LINE+3]]:1: ERROR: Unrecognized declaration introducer.
|
||||
// CHECK:STDERR: fail_no_intro_without_semi.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer
|
||||
// CHECK:STDERR: foo bar baz
|
||||
// CHECK:STDERR: ^~~
|
||||
foo bar baz
|
||||
|
||||
@@ -8,17 +8,17 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_paren_match_regression.carbon
|
||||
|
||||
// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+8]]:5: ERROR: Expected name in binding pattern.
|
||||
// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+8]]:5: error: expected name in binding pattern
|
||||
// CHECK:STDERR: var = (foo {})
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+4]]:12: ERROR: Expected `,` or `)`.
|
||||
// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+4]]:12: error: expected `,` or `)`
|
||||
// CHECK:STDERR: var = (foo {})
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var = (foo {})
|
||||
|
||||
// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+16]]:21: ERROR: `var` declarations must end with a `;`.
|
||||
// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+16]]:21: error: `var` declarations must end with a `;`
|
||||
// CHECK:STDERR: // CHECK:STDOUT: ]
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDOUT: - filename: fail_paren_match_regression.carbon
|
||||
|
||||
Reference in New Issue
Block a user