bison-patches
[Top][All Lists]
Advanced

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

[PATCH 3/6] style: comment and name changes


From: Akim Demaille
Subject: [PATCH 3/6] style: comment and name changes
Date: Sat, 2 Feb 2019 18:13:04 +0100

* src/output.c (prepare_symbol_names): here.
* src/reader.c: Remove obsolete comment.
* src/scan-code.l: Use || for Boolean or.
---
 src/output.c    | 11 +++++------
 src/reader.c    |  3 +--
 src/scan-code.l |  4 ++--
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/output.c b/src/output.c
index da600ae5..7132b4a9 100644
--- a/src/output.c
+++ b/src/output.c
@@ -137,9 +137,8 @@ string_output (FILE *out, char const *string)
 }
 
 
-/*----------------------------.
-| Prepare the symbols names.  |
-`----------------------------*/
+/* Generate the b4_<MUSCLE_NAME> (e.g., b4_tname) table with the
+   symbol names (aka tags). */
 
 static void
 prepare_symbol_names (char const *muscle_name)
@@ -430,13 +429,13 @@ prepare_symbol_definitions (void)
       key = obstack_finish0 (&format_obstack);
 
       /* Whether the symbol has an identifier.  */
-      const char *value = symbol_id_get (sym);
+      const char *id = symbol_id_get (sym);
       SET_KEY ("has_id");
-      MUSCLE_INSERT_INT (key, !!value);
+      MUSCLE_INSERT_INT (key, !!id);
 
       /* Its identifier.  */
       SET_KEY ("id");
-      MUSCLE_INSERT_STRING (key, value ? value : "");
+      MUSCLE_INSERT_STRING (key, id ? id : "");
 
       /* Its tag.  Typically for documentation purpose.  */
       SET_KEY ("tag");
diff --git a/src/reader.c b/src/reader.c
index 3d5d32a3..075d6c7a 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -829,8 +829,7 @@ check_and_convert_grammar (void)
   aver (nsyms <= SYMBOL_NUMBER_MAXIMUM);
   aver (nsyms == ntokens + nvars);
 
-  /* Assign the symbols their symbol numbers.  Write #defines for the
-     token symbols into FDEFINES if requested.  */
+  /* Assign the symbols their symbol numbers.  */
   symbols_pack ();
 
   /* Scan rule actions after invoking symbol_check_alias_consistency (in
diff --git a/src/scan-code.l b/src/scan-code.l
index 2677a79a..52349ffb 100644
--- a/src/scan-code.l
+++ b/src/scan-code.l
@@ -631,7 +631,7 @@ handle_action_dollar (symbol_list *rule, char *text, 
location dollar_loc)
         if (!type_name
             && !sym->content.sym->content->type_name)
           {
-            if (union_seen | tag_seen)
+            if (union_seen || tag_seen)
               {
                 if (rule->midrule_parent_rule)
                   complain (&dollar_loc, complaint,
@@ -665,7 +665,7 @@ handle_action_dollar (symbol_list *rule, char *text, 
location dollar_loc)
         if (!type_name
             && (!sym || !sym->content.sym->content->type_name))
           {
-            if (union_seen | tag_seen)
+            if (union_seen || tag_seen)
               complain (&dollar_loc, complaint,
                         _("$%s of %s has no declared type"), cp,
                         quote (effective_rule->content.sym->tag));
-- 
2.20.1




reply via email to

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