Lemon now writes errors to stderr instead of stdout, and uses full output.
The previous way truncated the filename, so my editor couldn't jump to the
problem line in the source code.
--- a/misc/lemon.c Fri Feb 12 13:40:25 2010 -0500
+++ b/misc/lemon.c Sat Feb 13 01:04:55 2010 -0500
@@ -1344,6 +1344,15 @@
#define LINEWIDTH 79 /* Max width of any output line */
#define PREFIXLIMIT 30 /* Max width of the prefix on each line */
void ErrorMsg(const char *filename, int lineno, const char *format, ...){
+#if __MOJOSHADER__
+ va_list ap;
+ fprintf(stderr, "%s:%d: ", filename, lineno);
+ va_start(ap, format);
+ vfprintf(stderr,format,ap);
+ va_end(ap);
+ fprintf(stderr, "\n");
+ fflush(stderr);
+#else
char errmsg[ERRMSGSIZE];
char prefix[PREFIXLIMIT+10];
int errmsgsize;
@@ -1380,6 +1389,7 @@
fprintf(stdout,"%s%.*s\n",prefix,end,&errmsg[base]);
base = restart;
}
+#endif
}
/**************** From the file "main.c" ************************************/
/*