X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/b7c49edf135cea5dc2bd0942b42d28e6c84cf71f..642cb8f8294e9ff6e8b17211e7119d4563fc2c2d:/tests/calc.at diff --git a/tests/calc.at b/tests/calc.at index 49cf4e23..f813c462 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -63,9 +63,16 @@ static void yyungetc (int c); extern void perror (const char *s); %} +/* Also exercise %union. */ +%union +{ + int ival; /* A comment to exercise an old bug. */ +}; + /* Bison Declarations */ %token CALC_EOF 0 "end of file" -%token NUM "number" +%token NUM "number" +%type exp %nonassoc '=' /* comparison */ %left '-' '+' @@ -84,7 +91,7 @@ input: line: '\n' -| exp '\n' +| exp '\n' {} ; exp: @@ -205,7 +212,7 @@ yylex (void) if (c == '.' || isdigit (c)) { yyungetc (c); - yylval = read_signed_integer (); + yylval.ival = read_signed_integer (); return NUM; } @@ -278,7 +285,7 @@ m4_define([_AT_CHECK_CALC], [AT_DATA([[input]], [[$2 ]]) -AT_CHECK([calc input], 0, [], [stderr])dnl +AT_CHECK([./calc input], 0, [], [stderr])dnl AT_CHECK([wc -l