mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 08:13:02 +00:00
diagnostics: use grammar_file instead of current_file
Currently there are two globals denoting the input file: grammar_file is the one from the command line, and current_file which might change because of #line. Use only the former. * src/complain.c (error_message): here. * tests/diagnostics.at: Adjust.
This commit is contained in:
@@ -425,7 +425,7 @@ error_message (const location *loc, int *indent, warnings flags,
|
|||||||
if (loc)
|
if (loc)
|
||||||
pos += location_print (*loc, stderr);
|
pos += location_print (*loc, stderr);
|
||||||
else
|
else
|
||||||
pos += fprintf (stderr, "%s", current_file ? current_file : program_name);
|
pos += fprintf (stderr, "%s", grammar_file ? grammar_file : program_name);
|
||||||
pos += fprintf (stderr, ": ");
|
pos += fprintf (stderr, ": ");
|
||||||
|
|
||||||
if (indent)
|
if (indent)
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ b: {}
|
|||||||
| <fixit-insert>%empty</fixit-insert>
|
| <fixit-insert>%empty</fixit-insert>
|
||||||
/dev/stdout:1.4-5: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
|
/dev/stdout:1.4-5: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
|
||||||
| <fixit-insert>%empty</fixit-insert>
|
| <fixit-insert>%empty</fixit-insert>
|
||||||
/dev/stdout: <warning>warning:</warning> fix-its can be applied. Rerun with option '--update'. [<warning>-Wother</warning>]
|
input.y: <warning>warning:</warning> fix-its can be applied. Rerun with option '--update'. [<warning>-Wother</warning>]
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user