diagnostics: improve -fcaret for list of accepted values

Instead of

  input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither'
   %define api.push_pull "neither"
           ^^^^^^^^^^^^^
  input.y:1.9-21:     accepted value: 'pull'
   %define api.push_pull "neither"
           ^^^^^^^^^^^^^
  input.y:1.9-21:     accepted value: 'push'
   %define api.push_pull "neither"
           ^^^^^^^^^^^^^
  input.y:1.9-21:     accepted value: 'both'
   %define api.push_pull "neither"
           ^^^^^^^^^^^^^

report

  input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither'
   %define api.push_pull "neither"
           ^^^^^^^^^^^^^
  input.y:1.9-21:     accepted value: 'pull'
  input.y:1.9-21:     accepted value: 'push'
  input.y:1.9-21:     accepted value: 'both'

* src/complain.h (no_caret): New.
* src/complain.c (error_message): Use it.
* src/muscle-tab.c (muscle_percent_define_check_values): Use it.
* src/scan-skel.l (flag): Ditto.
* tests/input.at: Adjust and check.
This commit is contained in:
Akim Demaille
2012-12-15 21:54:27 +01:00
parent bcd80897f3
commit ea9e670d72
5 changed files with 17 additions and 4 deletions

View File

@@ -114,7 +114,7 @@ error_message (const location *loc, warnings flags, const char *prefix,
{
putc ('\n', stderr);
fflush (stderr);
if (loc && feature_flag & feature_caret)
if (loc && feature_flag & feature_caret && !(flags & no_caret))
location_caret (stderr, *loc);
}
}