Module Name: src
Committed By: christos
Date: Sat May 19 01:52:49 UTC 2018
Modified Files:
src/external/bsd/byacc/dist: btyaccpar.skel
Log Message:
provide bison compatibility for YYLLOC_DEFAULT
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/byacc/dist/btyaccpar.skel
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/byacc/dist/btyaccpar.skel
diff -u src/external/bsd/byacc/dist/btyaccpar.skel:1.4 src/external/bsd/byacc/dist/btyaccpar.skel:1.5
--- src/external/bsd/byacc/dist/btyaccpar.skel:1.4 Mon Jun 5 14:54:30 2017
+++ src/external/bsd/byacc/dist/btyaccpar.skel Fri May 18 21:52:48 2018
@@ -74,17 +74,17 @@ do \
{ \
if (n == 0) \
{ \
- (loc).first_line = ((rhs)[-1]).last_line; \
- (loc).first_column = ((rhs)[-1]).last_column; \
- (loc).last_line = ((rhs)[-1]).last_line; \
- (loc).last_column = ((rhs)[-1]).last_column; \
+ (loc).first_line = YYRHSLOC(rhs, 0).last_line; \
+ (loc).first_column = YYRHSLOC(rhs, 0).last_column; \
+ (loc).last_line = YYRHSLOC(rhs, 0).last_line; \
+ (loc).last_column = YYRHSLOC(rhs, 0).last_column; \
} \
else \
{ \
- (loc).first_line = ((rhs)[ 0 ]).first_line; \
- (loc).first_column = ((rhs)[ 0 ]).first_column; \
- (loc).last_line = ((rhs)[n-1]).last_line; \
- (loc).last_column = ((rhs)[n-1]).last_column; \
+ (loc).first_line = YYRHSLOC(rhs, 1).first_line; \
+ (loc).first_column = YYRHSLOC(rhs, 1).first_column; \
+ (loc).last_line = YYRHSLOC(rhs, n).last_line; \
+ (loc).last_column = YYRHSLOC(rhs, n).last_column; \
} \
} while (0)
#endif /* YYLLOC_DEFAULT */
@@ -371,7 +371,7 @@ YYPARSE_DECL()
YYParseState *yyerrctx = NULL;
%%endif
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- YYLTYPE yyerror_loc_range[2]; /* position of error start & end */
+ YYLTYPE yyerror_loc_range[3]; /* position of error start&end (0 unused) */
#endif
#if YYDEBUG
const char *yys;
@@ -773,7 +773,7 @@ yyerrhandler:
YYERROR_CALL("syntax error");
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
- yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */
+ yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */
#endif
#if !YYBTYACC
@@ -802,7 +802,7 @@ yyinrecovery:
*++yystack.l_mark = yylval;
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
/* lookahead position is error end position */
- yyerror_loc_range[1] = yylloc;
+ yyerror_loc_range[2] = yylloc;
YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */
*++yystack.p_mark = yyloc;
#endif
@@ -818,7 +818,7 @@ yyinrecovery:
if (yystack.s_mark <= yystack.s_base) goto yyabort;
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
/* the current TOS position is the error start position */
- yyerror_loc_range[0] = *yystack.p_mark;
+ yyerror_loc_range[1] = *yystack.p_mark;
#endif
#if defined(YYDESTRUCT_CALL)
%%ifdef YYBTYACC
@@ -904,10 +904,10 @@ yyreduce:
if (!yytrial)
%%endif
{
- YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym);
+ YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym);
/* just in case YYERROR is invoked within the action, save
the start of the rhs as the error start position */
- yyerror_loc_range[0] = yystack.p_mark[1-yym];
+ yyerror_loc_range[1] = yystack.p_mark[1-yym];
}
#endif