[project @ 1996-11-21 16:45:53 by simonm]
[ghc-hetmet.git] / ghc / utils / ugen / yyerror.c
index 4b9a038..c7314f5 100644 (file)
@@ -1,24 +1,12 @@
 #include <stdio.h>
-extern int yylineno;
+extern int lineno;
+extern char *yytext;
 
-void
-yyerror(s)
-    char *s;
+void yyerror(s)
+     char *s;
 {
-       extern int yychar;
-       extern char yytext[1];
-
-       fprintf(stderr, "\n%s", s);
-       if(yylineno)
-               fprintf(stderr, ", line %d, ", yylineno);
-       fprintf(stderr, "on input: ");
-       if( yychar >= 0400 )
-               fprintf(stderr, "%s\n", &yytext[0]);
-       else
-               switch(yychar) {
-                 case '\t' : fprintf(stderr, "\\t\n"); break;
-                 case '\n' : fprintf(stderr, "\\n\n"); break;
-                 case '\0' : fprintf(stderr, "$end\n"); break;
-                 default   : fprintf(stderr, "%c\n", yychar); break;
-               }
+  fprintf(stderr, "\n%s", s);
+  if (lineno) fprintf(stderr, ", line %d, ", lineno);
+  fprintf(stderr, "on input: ");
+  fprintf(stderr, "%s\n", yytext);
 }