mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 17:53:02 +00:00
YYLLOC_DEFAULT: factor, and don't export it in headers.
* data/c++.m4, data/c.m4 (b4_yylloc_default_define): New. * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c: Use it. * data/glr.cc: Do not define YYLLOC_DEFAULT in the header file, but in the implementation one.
This commit is contained in:
@@ -298,25 +298,8 @@ m4_if(b4_prefix, [yy], [],
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
||||
If N is 0, then set CURRENT to the empty location which ends
|
||||
the previous symbol: RHS[0] (always defined). */
|
||||
|
||||
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
|
||||
#ifndef YYLLOC_DEFAULT
|
||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||
do \
|
||||
if (N) \
|
||||
{ \
|
||||
(Current).begin = YYRHSLOC (Rhs, 1).begin; \
|
||||
(Current).end = YYRHSLOC (Rhs, N).end; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
|
||||
} \
|
||||
while (false)
|
||||
#endif
|
||||
]b4_yylloc_default_define[
|
||||
|
||||
/* Suppress unused-variable warnings by "using" E. */
|
||||
#define YYUSE(e) ((void) (e))
|
||||
|
||||
Reference in New Issue
Block a user