* 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.
This commit is contained in:
Akim Demaille
2001-12-29 14:18:08 +00:00
parent e7b8bef1b1
commit 213e640e1e
3 changed files with 17 additions and 26 deletions

View File

@@ -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 <ival> NUM "number"
%type <ival> 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;
}