mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 13:23:04 +00:00
use a more consistent quoting style.
See <http://lists.gnu.org/archive/html/bug-bison/2012-01/msg00120.html>.
Use quotearg as often as possible instead of leaving the choice of
the quotes to the translators. Use shorter messages. Factor similar
messages to a single format, to make localization easier.
* src/files.c, src/getargs.c, src/muscle-tab.c, src/reader.c
* src/scan-code.l, src/scan-gram.l, src/symtab.c:
Use quote() or quotearg_colon() on printf arguments instead of
quotes in the format string.
* data/bison.m4: Keep sync with the changes in muscle-tab.c.
* tests/skeletons.at, tests/input.at, tests/regression.at: Adjust
expected messages.
(cherry picked from commit 4a9cd8f24a)
Conflicts:
src/muscle-tab.c
This commit is contained in:
@@ -26,7 +26,6 @@
|
||||
#include <c-strcase.h>
|
||||
#include <configmake.h>
|
||||
#include <error.h>
|
||||
#include <quotearg.h>
|
||||
|
||||
/* Hack to get <getopt.h> to declare getopt with a prototype. */
|
||||
#if lint && ! defined __GNU_LIBRARY__
|
||||
@@ -45,6 +44,7 @@
|
||||
#include "files.h"
|
||||
#include "getargs.h"
|
||||
#include "muscle-tab.h"
|
||||
#include "quote.h"
|
||||
#include "uniqstr.h"
|
||||
|
||||
bool debug_flag;
|
||||
@@ -424,14 +424,14 @@ language_argmatch (char const *arg, int prio, location loc)
|
||||
language = &valid_languages[i];
|
||||
return;
|
||||
}
|
||||
msg = _("invalid language '%s'");
|
||||
msg = _("%s: invalid language");
|
||||
}
|
||||
else if (language_prio == prio)
|
||||
msg = _("multiple language declarations are invalid");
|
||||
else
|
||||
return;
|
||||
|
||||
complain_at (loc, msg, arg);
|
||||
complain_at (loc, msg, quotearg_colon (arg));
|
||||
}
|
||||
|
||||
/*----------------------.
|
||||
@@ -679,9 +679,9 @@ getargs (int argc, char *argv[])
|
||||
if (argc - optind != 1)
|
||||
{
|
||||
if (argc - optind < 1)
|
||||
error (0, 0, _("missing operand after '%s'"), argv[argc - 1]);
|
||||
error (0, 0, _("%s: missing operand"), quotearg_colon (argv[argc - 1]));
|
||||
else
|
||||
error (0, 0, _("extra operand '%s'"), argv[optind + 1]);
|
||||
error (0, 0, _("extra operand %s"), quote (argv[optind + 1]));
|
||||
usage (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user