yacc.c: yyerror_range does not need to be preserved accross calls

* data/skeletons/yacc.c (b4_parse_state_variable_macros): Don't define
yyerror_range.
(yyparse): Add yyerror_range as local variable.
This commit is contained in:
Akim Demaille
2020-03-04 00:28:59 +01:00
parent 2f83ef57f3
commit 9cc76ee62c
2 changed files with 6 additions and 10 deletions

3
TODO
View File

@@ -95,9 +95,6 @@ See also the item "$undefined" below.
Consider deprecating impure push parsers. They add a lot of complexity, for
a bad feature.
It's not clear to me that yyerror_range really needs to be in pstate,
instead of just being a local variable.
* Bison 3.7
** Unit rules / Injection rules (Akim Demaille)
Maybe we could expand unit rules (or "injections", see

View File

@@ -211,10 +211,7 @@ m4_define([b4_declare_parser_state_variables],
/* The location stack. */
YYLTYPE yylsa[YYINITDEPTH];
YYLTYPE *yyls;
YYLTYPE *yylsp;
/* The locations where the error started and ended. */
YYLTYPE yyerror_range[3];]])[]b4_lac_if([[
YYLTYPE *yylsp;]])[]b4_lac_if([[
yy_state_t yyesa@{]b4_percent_define_get([[parse.lac.es-capacity-initial]])[@};
yy_state_t *yyes;
@@ -264,8 +261,7 @@ $1([yyvs])
$1([yyvsp])[]b4_locations_if([
$1([yylsa])
$1([yyls])
$1([yylsp])
$1([yyerror_range])])
$1([yylsp])])
$1([yystacksize])[]b4_lac_if([
$1([yyesa])
$1([yyes])
@@ -1559,7 +1555,10 @@ yyparse (]m4_ifset([b4_parse_param], [b4_formals(b4_parse_param)], [void])[)]])[
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;]b4_locations_if([[
YYLTYPE yyloc;]])[
YYLTYPE yyloc;
/* The locations where the error started and ended. */
YYLTYPE yyerror_range[3];]])[
]b4_parse_error_bmatch([detailed\|verbose],
[[ /* Buffer for error messages, and its allocated size. */