bison-patches
[Top][All Lists]
Advanced

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

cex: style changes


From: Akim Demaille
Subject: cex: style changes
Date: Fri, 19 Jun 2020 08:11:39 +0200

commit 9e75066819b51fa33cfe1438f55b017e080f0181
Author: Akim Demaille <akim.demaille@gmail.com>
Date:   Fri Jun 19 08:01:21 2020 +0200

    cex: style changes
    
    * src/counterexample.c: Simplify a bit.
    * src/parse-simulation.c, src/parse-simulation.h: Enforce coding style.

diff --git a/src/counterexample.c b/src/counterexample.c
index 7e952828..01114fdf 100644
--- a/src/counterexample.c
+++ b/src/counterexample.c
@@ -190,7 +190,7 @@ expand_to_conflict (state_item_number start, symbol_number 
conflict_sym)
     {
       node = (si_bfs_node *) gl_list_get_at (queue, 0);
       state_item *silast = state_items + node->si;
-      symbol_number sym = item_number_as_symbol_number (*(silast->item));
+      symbol_number sym = item_number_as_symbol_number (*silast->item);
       if (sym == conflict_sym)
         break;
       if (ISVAR (sym))
@@ -893,10 +893,10 @@ static bool
 has_common_prefix (const item_number *itm1, const item_number *itm2)
 {
   int i = 0;
-  for (; !item_number_is_rule_number (*(itm1 + i)); ++i)
-    if (*(itm1 + i) != *(itm2 + i))
+  for (; !item_number_is_rule_number (itm1[i]); ++i)
+    if (itm1[i] != itm2[i])
       return false;
-  return item_number_is_rule_number (*(itm2 + i));
+  return item_number_is_rule_number (itm2[i]);
 }
 
 /*
diff --git a/src/parse-simulation.c b/src/parse-simulation.c
index 615dbb2b..825f74e0 100644
--- a/src/parse-simulation.c
+++ b/src/parse-simulation.c
@@ -157,7 +157,7 @@ parse_state_derivation_completed (const parse_state *ps)
 derivation *
 parse_state_derivation (const parse_state *ps)
 {
-  return (derivation *)ps->derivs.head_elt;
+  return (derivation *) ps->derivs.head_elt;
 }
 
 const state_item *
diff --git a/src/parse-simulation.h b/src/parse-simulation.h
index ff759e37..76c4bff9 100644
--- a/src/parse-simulation.h
+++ b/src/parse-simulation.h
@@ -30,7 +30,7 @@
   Simulating states of the parser:
   Each state is an array of state-items and an array of derivations.
   Each consecutive state-item represents a transition/goto or production,
-  and the derivations are the dereivation trees associated with the symbols
+  and the derivations are the derivation trees associated with the symbols
   transitioned on each step. In more detail:
 
   Parse states are stored as a tree. Each new parse state contains two 
"chunks,"




reply via email to

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