From: Akim Demaille Date: Sat, 29 Dec 2001 14:18:08 +0000 (+0000) Subject: * tests/calc.at (_AT_DATA_CALC_Y): Also use %union. X-Git-Tag: before-m4-back-end~66 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/213e640e1e78a687369fe4760b82385c602ca876 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union. In addition, put a comment in there, to replace... * tests/regression.at (%union and C comments): Remove. --- diff --git a/ChangeLog b/ChangeLog index d9624264..38198129 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-12-29 Akim Demaille + + * tests/calc.at (_AT_DATA_CALC_Y): Also use %union. + In addition, put a comment in there, to replace... + * tests/regression.at (%union and C comments): Remove. + + 2001-12-29 Akim Demaille * tests/regression.at (Web2c Actions): Blindly move the actual diff --git a/tests/calc.at b/tests/calc.at index db308dfd..d12fffc9 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; } diff --git a/tests/regression.at b/tests/regression.at index d6c2fca3..9d55cf64 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -500,29 +500,6 @@ AT_CHECK([bison --defines input.y]) AT_CLEANUP -## --------------------------------------- ## -## Duplicate '/' in C comments in %union ## -## --------------------------------------- ## - - -AT_SETUP([%union and C comments]) - -AT_DATA([input.y], -[%union -{ - /* The int. */ int integer; - /* The string. */ char *string ; -} -%% -exp: {}; -]) - -AT_CHECK([bison input.y -o input.c]) -AT_CHECK([fgrep '//*' input.c], [1], []) - -AT_CLEANUP - - ## ----------------- ## ## Invalid input 1. ## ## ----------------- ##