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:
Akim Demaille
2019-10-22 09:01:19 +02:00
parent 6e7d8ba6a7
commit 4b4e532748
2 changed files with 2 additions and 2 deletions

View File

@@ -425,7 +425,7 @@ error_message (const location *loc, int *indent, warnings flags,
if (loc)
pos += location_print (*loc, stderr);
else
pos += fprintf (stderr, "%s", current_file ? current_file : program_name);
pos += fprintf (stderr, "%s", grammar_file ? grammar_file : program_name);
pos += fprintf (stderr, ": ");
if (indent)