]> git.saurik.com Git - bison.git/commitdiff
tests: reorder.
authorAkim Demaille <akim@lrde.epita.fr>
Mon, 11 Jun 2012 14:43:42 +0000 (16:43 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Fri, 15 Jun 2012 11:36:01 +0000 (13:36 +0200)
* tests/calc.at (power): Move its definition, as a preparation for
forthcoming changes.
And space changes.

tests/calc.at

index c50400836a5ad684ce0443db4643ac877a0aec2f..790c4e6340cbe24e15f3067631522471c585a5d1 100644 (file)
@@ -250,7 +250,7 @@ int yylex (]AT_LEX_FORMALS[);
 %token <ival> NUM "number"
 %type  <ival> exp
 
-%nonassoc '=' /* comparison           */
+%nonassoc '=' /* comparison            */
 %left '-' '+'
 %left '*' '/'
 %left NEG     /* negation--unary minus */
@@ -289,6 +289,16 @@ exp:
 ;
 %%
 
+static int
+power (int base, int exponent)
+{
+  int res = 1;
+  assert (0 <= exponent);
+  for (/* Niente */; exponent; --exponent)
+    res *= base;
+  return res;
+}
+
 ]AT_SKEL_CC_IF(
 [AT_LOCATION_TYPE_IF([[
   std::ostream&
@@ -334,27 +344,16 @@ AT_YYERROR_SEES_LOC_IF([
            AT_LOC_FIRST_LINE, AT_LOC_FIRST_COLUMN);
   if (AT_LOC_FIRST_LINE != AT_LOC_LAST_LINE)
     fprintf (stderr, "-%d.%d",
-            AT_LOC_LAST_LINE,  AT_LOC_LAST_COLUMN - 1);
+             AT_LOC_LAST_LINE,  AT_LOC_LAST_COLUMN - 1);
   else if (AT_LOC_FIRST_COLUMN != AT_LOC_LAST_COLUMN - 1)
     fprintf (stderr, "-%d",
-            AT_LOC_LAST_COLUMN - 1);
+             AT_LOC_LAST_COLUMN - 1);
   fprintf (stderr, ": ");])
   fprintf (stderr, "%s\n", s);
 }])[
 
 ]AT_DEFINES_IF(, [AT_CALC_LEX])[
 
-static int
-power (int base, int exponent)
-{
-  int res = 1;
-  assert (0 <= exponent);
-  for (/* Niente */; exponent; --exponent)
-    res *= base;
-  return res;
-}
-
-
 /* A C main function.  */
 int
 main (int argc, const char **argv)