[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
glr: style change
From: |
Akim Demaille |
Subject: |
glr: style change |
Date: |
Sat, 30 Nov 2019 16:41:32 +0100 |
commit 9471a5ffe95b519fe386a067513d65237253c582
Author: Akim Demaille <address@hidden>
Date: Sat Nov 30 13:27:04 2019 +0100
glr: style change
* data/skeletons/glr.c (YYDPRINTF): Expand into an empty statement,
instead of nothing.
Simplify callers.
diff --git a/data/skeletons/glr.c b/data/skeletons/glr.c
index f1f3715f..cc08ee4f 100644
--- a/data/skeletons/glr.c
+++ b/data/skeletons/glr.c
@@ -502,7 +502,7 @@ static void yypdumpstack (struct yyGLRStack* yystackp)
#else /* !]b4_api_PREFIX[DEBUG */
-# define YYDPRINTF(Args)
+# define YYDPRINTF(Args) do {} while (yyfalse)
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
#endif /* !]b4_api_PREFIX[DEBUG */
@@ -1272,9 +1272,7 @@ yyremoveDeletes (yyGLRStack* yystackp)
if (yystackp->yytops.yystates[yyi] == YY_NULLPTR)
{
if (yyi == yyj)
- {
- YYDPRINTF ((stderr, "Removing dead stacks.\n"));
- }
+ YYDPRINTF ((stderr, "Removing dead stacks.\n"));
yystackp->yytops.yysize -= 1;
}
else
@@ -1288,10 +1286,8 @@ yyremoveDeletes (yyGLRStack* yystackp)
yystackp->yytops.yylookaheadNeeds[yyj] =
yystackp->yytops.yylookaheadNeeds[yyi];
if (yyj != yyi)
- {
- YYDPRINTF ((stderr, "Rename stack %ld -> %ld.\n",
- YY_CAST (long, yyi), YY_CAST (long, yyj)));
- }
+ YYDPRINTF ((stderr, "Rename stack %ld -> %ld.\n",
+ YY_CAST (long, yyi), YY_CAST (long, yyj)));
yyj += 1;
}
yyi += 1;
@@ -1451,11 +1447,9 @@ yyglrReduce (yyGLRStack* yystackp, ptrdiff_t yyk,
yyRuleNum yyrule,
YYRESULTTAG yyflag = yydoAction (yystackp, yyk, yyrule,
&yysval]b4_locuser_args([&yyloc])[);
if (yyflag == yyerr && yystackp->yysplitPoint != YY_NULLPTR)
- {
- YYDPRINTF ((stderr,
- "Parse on stack %ld rejected by rule %d (line %d).\n",
- YY_CAST (long, yyk), yyrule - 1, yyrline[yyrule - 1]));
- }
+ YYDPRINTF ((stderr,
+ "Parse on stack %ld rejected by rule %d (line %d).\n",
+ YY_CAST (long, yyk), yyrule - 1, yyrline[yyrule - 1]));
if (yyflag != yyok)
return yyflag;
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyrule], &yysval, &yyloc);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- glr: style change,
Akim Demaille <=