diff options
author | Victor Morales Cayuela <victor.morales_cayuela@nokia-sbell.com> | 2020-02-14 18:41:55 +0100 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2020-02-15 08:28:40 +0100 |
commit | e09a72eeb0429ee1eee9b0bdc986ab046d8d2532 (patch) | |
tree | 4e06ea4a32f0621eda21e1570fb3138d496c309c /src/scan-skel.l | |
parent | a09d0ae4d177592bc132e4a3733bf0c7a6ddeb6a (diff) | |
download | bison-e09a72eeb0429ee1eee9b0bdc986ab046d8d2532.tar.gz |
diagnostics: modernize the display of submessages
Since Bison 2.7, output was indented four spaces for explanatory
statements. For example:
input.y:2.7-13: error: %type redeclaration for exp
input.y:1.7-11: previous declaration
Since the introduction of caret-diagnostics, it became less clear.
Remove the indentation and display submessages as in GCC:
input.y:2.7-13: error: %type redeclaration for exp
2 | %type <float> exp
| ^~~~~~~
input.y:1.7-11: note: previous declaration
1 | %type <int> exp
| ^~~~~
* src/complain.h (SUB_INDENT): Remove.
(warnings): Add "note" to the enum.
* src/complain.h, src/complain.c (complain_indent): Replace by...
(subcomplain): this.
Adjust all dependencies.
* tests/actions.at, tests/diagnostics.at, tests/glr-regression.at,
* tests/input.at, tests/named-refs.at, tests/regression.at:
Adjust expectations.
Diffstat (limited to 'src/scan-skel.l')
-rw-r--r-- | src/scan-skel.l | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/scan-skel.l b/src/scan-skel.l index 0cd308a8..2ffdcfc2 100644 --- a/src/scan-skel.l +++ b/src/scan-skel.l @@ -189,7 +189,7 @@ flag (const char *arg) else if (STREQ (arg, "fatal")) return fatal; else if (STREQ (arg, "note")) - return silent | complaint | no_caret; + return silent | complaint | no_caret | note; else if (STREQ (arg, "warn")) return Wother; else @@ -225,14 +225,7 @@ at_complain (int argc, char *argv[], char **out_namep, int *out_linenop) boundary_set_from_string (&loc.end, argv[3]); locp = &loc; } - static int indent; - if (w & silent) - indent += SUB_INDENT; - else - indent = 0; - complain_args (locp, w, &indent, argc - 4, argv + 4); - if (w & silent) - indent -= SUB_INDENT; + complain_args (locp, w, argc - 4, argv + 4); } static void |