[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
11-fyi-calc-uses-union.patch
From: |
Akim Demaille |
Subject: |
11-fyi-calc-uses-union.patch |
Date: |
Sat, 29 Dec 2001 15:14:07 +0100 |
Index: ChangeLog
from Akim Demaille <address@hidden>
* 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.
Index: tests/calc.at
--- tests/calc.at Thu, 27 Dec 2001 17:59:53 +0100 akim
+++ tests/calc.at Fri, 28 Dec 2001 15:57:27 +0100 akim
@@ -63,9 +63,16 @@ m4_define([_AT_DATA_CALC_Y],
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 @@ exp:
if (c == '.' || isdigit (c))
{
yyungetc (c);
- yylval = read_signed_integer ();
+ yylval.ival = read_signed_integer ();
return NUM;
}
Index: tests/regression.at
--- tests/regression.at Fri, 28 Dec 2001 15:38:30 +0100 akim
+++ tests/regression.at Fri, 28 Dec 2001 15:58:10 +0100 akim
@@ -500,29 +500,6 @@ exp: {};
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. ##
## ----------------- ##
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- 11-fyi-calc-uses-union.patch,
Akim Demaille <=