]> git.saurik.com Git - bison.git/blobdiff - tests/named-refs.at
glr.c: formatting changes.
[bison.git] / tests / named-refs.at
index 62c46211bcc58d84845b49b45fcc8c26871abe6f..0b2f4c94ef1641ebf9e6e5b86b284eed402b96ec 100644 (file)
@@ -15,6 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# FIXME: Duplication with calc.at.
 AT_BANNER([[Named references tests.]])
 
 AT_SETUP([Tutorial calculator])
 AT_BANNER([[Named references tests.]])
 
 AT_SETUP([Tutorial calculator])
@@ -22,6 +23,7 @@ AT_SETUP([Tutorial calculator])
 AT_DATA_GRAMMAR([test.y],
 [[
 %{
 AT_DATA_GRAMMAR([test.y],
 [[
 %{
+#include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -142,8 +144,7 @@ int yylex (void)
 static int power (int base, int exponent)
 {
   int res = 1;
 static int power (int base, int exponent)
 {
   int res = 1;
-  if (exponent < 0)
-    exit (3);
+  assert (0 <= exponent);
   for (/* Niente */; exponent; --exponent)
     res *= base;
   return res;
   for (/* Niente */; exponent; --exponent)
     res *= base;
   return res;