[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/7] yacc.c: style changes in push mode
From: |
Akim Demaille |
Subject: |
[PATCH 2/7] yacc.c: style changes in push mode |
Date: |
Sun, 28 Jun 2020 16:52:15 +0200 |
* data/skeletons/yacc.c: here.
---
data/skeletons/yacc.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/data/skeletons/yacc.c b/data/skeletons/yacc.c
index b763332f..3aa56604 100644
--- a/data/skeletons/yacc.c
+++ b/data/skeletons/yacc.c
@@ -2046,13 +2046,13 @@ yyabortlab:
yyexhaustedlab:
yyerror (]b4_yyerror_args[YY_("memory exhausted"));
yyresult = 2;
- /* Fall through. */
+ goto yyreturn;
#endif
-/*-----------------------------------------------------.
-| yyreturn -- parsing is finished, return the result. |
-`-----------------------------------------------------*/
+/*-------------------------------------------------------.
+| yyreturn -- parsing is finished, clean up and return. |
+`-------------------------------------------------------*/
yyreturn:
if (yychar != ]b4_symbol(-2, id)[)
{
@@ -2080,11 +2080,12 @@ yyreturn:
YYSTACK_FREE (yyes);]])b4_push_if([[
yypstate_clear (yyps);
yyps->yynew = 1;
+ goto yypushreturn;
-/*-----------------------------------------.
-| yypushreturn -- ask for the next token. |
-`-----------------------------------------*/
+/*-------------------------.
+| yypushreturn -- return. |
+`-------------------------*/
yypushreturn:]])[
]b4_parse_error_bmatch([detailed\|verbose],
[[ if (yymsg != yymsgbuf)
--
2.27.0
- [PATCH 0/7] RFC: yypstate_clear (ATTENTION push parser users), Akim Demaille, 2020/06/28
- [PATCH 1/7] yacc.c: simplify yypull_parse, Akim Demaille, 2020/06/28
- [PATCH 2/7] yacc.c: style changes in push mode,
Akim Demaille <=
- [PATCH 3/7] yacc.c: declare and initialize and the same time, Akim Demaille, 2020/06/28
- [PATCH 4/7] regen, Akim Demaille, 2020/06/28
- [PATCH 5/7] yacc.c: simplify initialization of push parsers, Akim Demaille, 2020/06/28
- [PATCH 6/7] bistromathic: don't display undefined locations, Akim Demaille, 2020/06/28
- [PATCH 7/7] yacc.c: push: don't clear the parser state when accepting/rejecting, Akim Demaille, 2020/06/28