X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/793a58bb66dbb11d5971b2cd3fe9d0827c6c84b6..6876ecd36eacdc5dbcb193d9caea5a56fa8e907b:/tests/glr-regr1.at diff --git a/tests/glr-regr1.at b/tests/glr-regr1.at index 39b7b9a3..72aec705 100644 --- a/tests/glr-regr1.at +++ b/tests/glr-regr1.at @@ -20,12 +20,12 @@ AT_BANNER([[GLR Regression Test #1.]]) AT_SETUP([Badly Collapsed GLR States]) -AT_DATA([glr-regr1.y], +AT_DATA_GRAMMAR([glr-regr1.y], [[/* Regression Test: Improper state compression */ /* Reported by Scott McPeak */ %{ -#include // fgetc, printf +#include #define YYSTYPE int static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1); @@ -63,29 +63,28 @@ static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1) int main (void) { - yyparse(); - return 0; + return yyparse (); } int yyerror (char const *msg) { - printf("%s\n", msg); - exit(4); + fprintf (stderr, "%s\n", msg); + exit (4); } int yylex (void) { - while (1) { - int ch = fgetc(stdin); - if (ch == EOF) { - return 0; // bison's EOF - } else if (ch == 'B' || ch == 'P') { - return ch; + for (;;) + { + int ch = getchar (); + if (ch == EOF) + return 0; + else if (ch == 'B' || ch == 'P') + return ch; } - } } ]])