warnings: factoring: complaints

* src/complain.c (error_message): Accept warning categories (an integer) as
argument.
Location is a 'const location *' instead of 'location *'.
(ERROR_MESSAGE): Delete it.
* src/complain.c, src/complain.h (complains): New function.
(complain, complain_at, complain_at_indent): Generic functions for
complaints. Call 'complains'.
(warn_at, warn_at_indent, warn, yacc_at, midrule_value_at)
(fatal_at, fatal): Delete them. Adjust dependencies.
* src/complain.h (enum warnings): New fields 'complaint' and 'fatal'.
* bootstrap.conf (XGETTEXT_OPTIONS): Adjust.
This commit is contained in:
Victor Santet
2012-06-28 16:44:21 +02:00
committed by Akim Demaille
parent d0f11c1b62
commit 6fb8b25619
17 changed files with 310 additions and 364 deletions

View File

@@ -24,7 +24,6 @@
#include "complain.h"
#include "symlist.h"
/*--------------------------------------.
| Create a list containing SYM at LOC. |
`--------------------------------------*/
@@ -212,7 +211,7 @@ symbol_list_n_type_name_get (symbol_list *l, location loc, int n)
l = symbol_list_n_get (l, n);
if (!l)
{
complain_at (loc, _("invalid $ value: $%d"), n);
complain_at (loc, complaint, _("invalid $ value: $%d"), n);
return NULL;
}
aver (l->content_type == SYMLIST_SYMBOL);