ref: 68bba88d780d72043f1a954f3dbd12ad39bb5300
parent: 93c94e8c4070d8018a79014e8f5f07d00115462c
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Aug 27 15:09:57 EDT 2023
yacc: define dummy yytokname() and yystatname() macros if not yydebug
--- a/sys/lib/yaccpar
+++ b/sys/lib/yaccpar
@@ -4,20 +4,7 @@
#ifdef yydebug
#include "y.debug"
-#else
-#define yydebug 0
-char* yytoknames[1]; /* for debugging */
-char* yystates[1]; /* for debugging */
-#endif
-/* parser for yacc output */
-
-int yynerrs = 0; /* number of errors */
-int yyerrflag = 0; /* error recovery flag */
-
-extern int fprint(int, char*, ...);
-extern int sprint(char*, char*, ...);
-
char*
yytokname(int yyc)
{
@@ -41,6 +28,17 @@
sprint(x, "<%d>\n", yys);
return x;
}
+#else
+#define yydebug 0
+#define yytokname(x) ""
+#define yystatname(x) ""
+#endif
+
+/* parser for yacc output */
+
+int yynerrs = 0; /* number of errors */
+int yyerrflag = 0; /* error recovery flag */
+
long
yylex1(void)