]> git.saurik.com Git - bison.git/blobdiff - src/muscle-tab.c
misc: document TESTSUITEFLAGS in README-hacking
[bison.git] / src / muscle-tab.c
index be97b800fdb0b5611c8f620eaeb31d3a7351a7f6..f3933c3faf02412f37bd3d792c165ecfe6c7a4ce 100644 (file)
@@ -398,7 +398,11 @@ muscle_percent_variable_update (char const *variable, location variable_loc)
   const conversion_type conversion[] =
     {
       { "api.push_pull", "api.push-pull", },
-      { "lr.keep_unreachable_states", "lr.keep-unreachable-states", },
+      { "api.tokens.prefix", "api.token.prefix", },
+      { "location_type", "api.location.type", },
+      { "lr.default-reductions", "lr.default-reduction", },
+      { "lr.keep-unreachable-states", "lr.keep-unreachable-state", },
+      { "lr.keep_unreachable_states", "lr.keep-unreachable-state", },
       { "namespace", "api.namespace", },
     };
   char const *res = variable;
@@ -416,23 +420,17 @@ muscle_percent_variable_update (char const *variable, location variable_loc)
 }
 
 void
-muscle_percent_define_insert (char const *variable, location variable_loc,
+muscle_percent_define_insert (char const *var, location variable_loc,
                               char const *value,
                               muscle_percent_define_how how)
 {
-  char const *name;
-  char const *loc_name;
-  char const *syncline_name;
-  char const *how_name;
-
-  /* Permit certain names with underscores for backward compatibility.  */
-  variable = muscle_percent_variable_update (variable, variable_loc);
-
-  name = UNIQSTR_CONCAT ("percent_define(", variable, ")");
-  loc_name = UNIQSTR_CONCAT ("percent_define_loc(", variable, ")");
-  syncline_name =
+  /* Backward compatibility.  */
+  char const *variable = muscle_percent_variable_update (var, variable_loc);
+  char const *name = UNIQSTR_CONCAT ("percent_define(", variable, ")");
+  char const *loc_name = UNIQSTR_CONCAT ("percent_define_loc(", variable, ")");
+  char const *syncline_name =
     UNIQSTR_CONCAT ("percent_define_syncline(", variable, ")");
-  how_name = UNIQSTR_CONCAT ("percent_define_how(", variable, ")");
+  char const *how_name = UNIQSTR_CONCAT ("percent_define_how(", variable, ")");
 
   /* Command-line options are processed before the grammar file.  */
   if (how == MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
@@ -442,13 +440,12 @@ muscle_percent_define_insert (char const *variable, location variable_loc,
       unsigned i = 0;
       if (how_old == MUSCLE_PERCENT_DEFINE_F)
         return;
-      complain_at_indent (variable_loc, complaint, &i,
-                          _("%%define variable %s redefined"),
-                          quote (variable));
+      complain_indent (&variable_loc, complaint, &i,
+                       _("%%define variable %s redefined"),
+                       quote (variable));
       i += SUB_INDENT;
-      complain_at_indent (muscle_percent_define_get_loc (variable),
-                          complaint, &i,
-                          _("previous definition"));
+      location loc = muscle_percent_define_get_loc (variable);
+      complain_indent (&loc, complaint, &i, _("previous definition"));
     }
 
   MUSCLE_INSERT_STRING (name, value);
@@ -606,14 +603,13 @@ muscle_percent_define_check_values (char const * const *values)
             {
               unsigned i = 0;
               location loc = muscle_percent_define_get_loc (*variablep);
-              complain_at_indent
-                (loc, complaint, &i,
-                 _("invalid value for %%define variable %s: %s"),
-                 quote (*variablep), quote_n (1, value));
+              complain_indent (&loc, complaint, &i,
+                               _("invalid value for %%define variable %s: %s"),
+                               quote (*variablep), quote_n (1, value));
               i += SUB_INDENT;
               for (values = variablep + 1; *values; ++values)
-                complain_at_indent (loc, complaint, &i, _("accepted value: %s"),
-                                    quote (*values));
+                complain_indent (&loc, complaint, &i, _("accepted value: %s"),
+                                 quote (*values));
             }
           else
             {