bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

style: address syntax-check diagnostics


From: Akim Demaille
Subject: style: address syntax-check diagnostics
Date: Mon, 21 Dec 2020 16:06:12 +0100

commit c0f3b55b2542882b1e735b57d7997a807c9fcaf4
Author: Akim Demaille <akim.demaille@gmail.com>
Date:   Mon Dec 21 07:51:02 2020 +0100

    style: address syntax-check diagnostics
    
    * examples/c/glr/c++-types.y: Formatting changes.
    * po/POTFILES.in: Add missing files.
    * src/reader.c: Remove useless include.
    * tests/calc.at: Avoid magic values for exit.
    Obfuscate calls to error.

diff --git a/examples/c/glr/c++-types.y b/examples/c/glr/c++-types.y
index a6118c0b..33d1abc6 100644
--- a/examples/c/glr/c++-types.y
+++ b/examples/c/glr/c++-types.y
@@ -295,4 +295,3 @@ stmtMerge (YYSTYPE x0, YYSTYPE x1)
 {
   return new_nterm ("<OR>(%s,%s)", x0, x1, NULL);
 }
-
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 5b15e936..c9647675 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -14,6 +14,7 @@ src/main.c
 src/muscle-tab.c
 src/parse-gram.y
 src/print-graph.c
+src/print-xml.c
 src/print.c
 src/reader.c
 src/reduce.c
diff --git a/src/reader.c b/src/reader.c
index 8f77fc72..786e38f6 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -21,7 +21,6 @@
 #include <config.h>
 #include "system.h"
 
-#include <c-ctype.h>
 #include <quote.h>
 #include <vasnprintf.h>
 
@@ -349,7 +348,7 @@ grammar_rule_check_and_complete (symbol_list *r)
       const symbol *start = r->next->next->content.sym;
       if (start->content->type_name)
         obstack_printf (obstack_for_actions,
-                        "{ ]b4_accept([%s%d])[; }",
+                        "{ ]b4_accept""([%s%d])[; }",
                         start->content->class == nterm_sym ? "orig " : "",
                         start->content->number);
       else
diff --git a/tests/calc.at b/tests/calc.at
index 75b64e10..6fd19e1a 100644
--- a/tests/calc.at
+++ b/tests/calc.at
@@ -84,6 +84,10 @@ int global_count = 0;
 /* Total number of errors.  */
 int global_nerrs = 0;
 
+#ifndef EX_NOINPUT
+# define EX_NOINPUT 66
+#endif
+
 static FILE *
 open_file (const char *file)
 {
@@ -91,7 +95,7 @@ open_file (const char *file)
   if (!res)
     {
       perror (file);
-      exit (3);
+      exit (EX_NOINPUT);
     }
   return res;
 }
@@ -424,14 +428,14 @@ exp:
         {
           YYLTYPE old_yylloc = yylloc;
           yylloc = @3;
-          yyerror (]AT_PARAM_IF([result, count, nerrs, ])["error: null 
divisor");
+          yyerr][or (]AT_PARAM_IF([result, count, nerrs, ])["error: null 
divisor");
           yylloc = old_yylloc;
         }
         ]])[
       }]],
       [c++], [[
       {
-        ]AT_GLR_IF([[yyparser.]])[error (]AT_LOCATION_IF([[@3, ]])["error: 
null divisor");
+        ]AT_GLR_IF([[yyparser.]])[err][or (]AT_LOCATION_IF([[@3, ]])["error: 
null divisor");
       }]])[
     else
       $$ = $1 / $3;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]