cex: style changes

* src/counterexample.c: Simplify a bit.
* src/parse-simulation.c, src/parse-simulation.h: Enforce coding style.
This commit is contained in:
Akim Demaille
2020-06-19 08:01:21 +02:00
parent efb65daa36
commit 9e75066819
3 changed files with 6 additions and 6 deletions

View File

@@ -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]);
}
/*

View File

@@ -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 *

View File

@@ -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,"