ref: 8c159e9284fd9079b4ef08e3911baf3901f43a5a
parent: de5aff13ba41a5f2a14ecf7b0ad3db5843957a96
author: Tevo <estevan.cps@gmail.com>
date: Sat Feb 13 19:56:42 EST 2021
Actually crash on parser error
--- a/misc.c
+++ b/misc.c
@@ -51,13 +51,22 @@
return str;
}
+/* it's a mess */
+
void
-yyerror(char *str)
+yywarn(char *str)
{
extern int yylineno;
fprint(2, "%s:%d: %s\n", fname, yylineno, str);
}
+void
+yyerror(char *str)
+{
+ yywarn(str);
+ exits(str);
+}
+
char*
setstr(char *baseline, char **dest, char *str)
{
@@ -84,7 +93,7 @@
va_start(args, fmt);
str = vsmprint(fmt, args);
- yyerror(str);
+ yywarn(str);
free(str);
va_end(args);
}
@@ -97,7 +106,7 @@
va_start(args, fmt);
str = vsmprint(fmt, args);
- yyerror(str);
+ yywarn(str);
free(str);
va_end(args);
exits("cantparse");