mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 10:13:03 +00:00
style: reduce length of private constant
* data/skeletons/glr.c, data/skeletons/lalr1.cc, data/skeletons/yacc.c (YYERROR_VERBOSE_ARGS_MAXIMUM): Rename as... (YYARGS_MAX): this. * src/parse-gram.y (YYERROR_VERBOSE_ARGS_MAXIMUM): Rename as... (ARGS_MAX): this.
This commit is contained in:
@@ -2198,18 +2198,18 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
|
|||||||
[[ {
|
[[ {
|
||||||
yybool yysize_overflow = yyfalse;
|
yybool yysize_overflow = yyfalse;
|
||||||
char* yymsg = YY_NULLPTR;
|
char* yymsg = YY_NULLPTR;
|
||||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
enum { YYARGS_MAX = 5 };
|
||||||
/* Internationalized format string. */
|
/* Internationalized format string. */
|
||||||
const char *yyformat = YY_NULLPTR;
|
const char *yyformat = YY_NULLPTR;
|
||||||
/* Arguments of yyformat: reported tokens (one for the "unexpected",
|
/* Arguments of yyformat: reported tokens (one for the "unexpected",
|
||||||
one per "expected"). */
|
one per "expected"). */
|
||||||
yySymbol yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
yySymbol yyarg[YYARGS_MAX];
|
||||||
/* Cumulated lengths of YYARG. */
|
/* Cumulated lengths of YYARG. */
|
||||||
ptrdiff_t yysize = 0;
|
ptrdiff_t yysize = 0;
|
||||||
|
|
||||||
/* Actual size of YYARG. */
|
/* Actual size of YYARG. */
|
||||||
int yycount
|
int yycount
|
||||||
= yysyntax_error_arguments (yystackp, yyarg, YYERROR_VERBOSE_ARGS_MAXIMUM);
|
= yysyntax_error_arguments (yystackp, yyarg, YYARGS_MAX);
|
||||||
if (yycount == -2)
|
if (yycount == -2)
|
||||||
yyMemoryExhausted (yystackp);
|
yyMemoryExhausted (yystackp);
|
||||||
|
|
||||||
|
|||||||
@@ -1467,10 +1467,10 @@ b4_dollar_popdef])[]dnl
|
|||||||
]b4_parser_class[::yysyntax_error_ (const context& yyctx) const
|
]b4_parser_class[::yysyntax_error_ (const context& yyctx) const
|
||||||
{
|
{
|
||||||
// Its maximum.
|
// Its maximum.
|
||||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
enum { YYARGS_MAX = 5 };
|
||||||
// Arguments of yyformat.
|
// Arguments of yyformat.
|
||||||
int yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
int yyarg[YYARGS_MAX];
|
||||||
int yycount = yyctx.yysyntax_error_arguments (yyarg, YYERROR_VERBOSE_ARGS_MAXIMUM);
|
int yycount = yyctx.yysyntax_error_arguments (yyarg, YYARGS_MAX);
|
||||||
|
|
||||||
char const* yyformat = YY_NULLPTR;
|
char const* yyformat = YY_NULLPTR;
|
||||||
switch (yycount)
|
switch (yycount)
|
||||||
|
|||||||
@@ -1367,18 +1367,17 @@ static int
|
|||||||
yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
|
yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
|
||||||
const yyparse_context_t *yyctx)
|
const yyparse_context_t *yyctx)
|
||||||
{
|
{
|
||||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
enum { YYARGS_MAX = 5 };
|
||||||
/* Internationalized format string. */
|
/* Internationalized format string. */
|
||||||
const char *yyformat = YY_NULLPTR;
|
const char *yyformat = YY_NULLPTR;
|
||||||
/* Arguments of yyformat: reported tokens (one for the "unexpected",
|
/* Arguments of yyformat: reported tokens (one for the "unexpected",
|
||||||
one per "expected"). */
|
one per "expected"). */
|
||||||
int yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
int yyarg[YYARGS_MAX];
|
||||||
/* Cumulated lengths of YYARG. */
|
/* Cumulated lengths of YYARG. */
|
||||||
YYPTRDIFF_T yysize = 0;
|
YYPTRDIFF_T yysize = 0;
|
||||||
|
|
||||||
/* Actual size of YYARG. */
|
/* Actual size of YYARG. */
|
||||||
int yycount
|
int yycount = yysyntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
|
||||||
= yysyntax_error_arguments (yyctx, yyarg, YYERROR_VERBOSE_ARGS_MAXIMUM);
|
|
||||||
if (yycount == -2)
|
if (yycount == -2)
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
|
|||||||
@@ -801,14 +801,14 @@ epilogue.opt:
|
|||||||
int
|
int
|
||||||
yyreport_syntax_error (const yyparse_context_t *ctx)
|
yyreport_syntax_error (const yyparse_context_t *ctx)
|
||||||
{
|
{
|
||||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
enum { ARGS_MAX = 5 };
|
||||||
/* Arguments of format: reported tokens (one for the "unexpected",
|
/* Arguments of format: reported tokens (one for the "unexpected",
|
||||||
one per "expected"). */
|
one per "expected"). */
|
||||||
int arg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
int arg[ARGS_MAX];
|
||||||
int n = yysyntax_error_arguments (ctx, arg, YYERROR_VERBOSE_ARGS_MAXIMUM);
|
int n = yysyntax_error_arguments (ctx, arg, ARGS_MAX);
|
||||||
if (n == -2)
|
if (n == -2)
|
||||||
return 2;
|
return 2;
|
||||||
const char *argv[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
const char *argv[ARGS_MAX];
|
||||||
for (int i = 0; i < n; ++i)
|
for (int i = 0; i < n; ++i)
|
||||||
argv[i] = yysymbol_name (arg[i]);
|
argv[i] = yysymbol_name (arg[i]);
|
||||||
syntax_error (*yyparse_context_location (ctx), n, argv);
|
syntax_error (*yyparse_context_location (ctx), n, argv);
|
||||||
|
|||||||
Reference in New Issue
Block a user