Underline the entire token when producing diagnostic messages. (#3413)

This is an incremental improvement on our diagnostic messages that
simply underlines an entire token if the token is larger than 1 char
(else it points to the single char with a caret like it used to).
This commit is contained in:
Jacob Schneider
2023-11-27 16:36:26 +00:00
committed by GitHub
parent 437b5e60d6
commit 1d443a3617
98 changed files with 270 additions and 230 deletions
@@ -6,7 +6,7 @@
// CHECK:STDERR: fail_identifier_instead_of_sig.carbon:[[@LINE+3]]:8: ERROR: `fn` requires a `(` for parameters.
// CHECK:STDERR: fn foo bar;
// CHECK:STDERR: ^
// CHECK:STDERR: ^~~
fn foo bar;
// CHECK:STDOUT: - filename: fail_identifier_instead_of_sig.carbon
@@ -6,7 +6,7 @@
// CHECK:STDERR: fail_repeated_fn_and_semi.carbon:[[@LINE+3]]:4: ERROR: `fn` introducer should be followed by a name.
// CHECK:STDERR: fn fn;
// CHECK:STDERR: ^
// CHECK:STDERR: ^~
fn fn;
// CHECK:STDOUT: - filename: fail_repeated_fn_and_semi.carbon
@@ -6,7 +6,7 @@
// CHECK:STDERR: fail_skip_without_semi_to_curly.carbon:[[@LINE+3]]:1: ERROR: Unrecognized declaration introducer.
// CHECK:STDERR: struct X { fn () }
// CHECK:STDERR: ^
// CHECK:STDERR: ^~~~~~
struct X { fn () }
fn F();