summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2019-04-12 08:30:15 +0200
committerAkim Demaille <akim.demaille@gmail.com>2019-04-12 08:38:30 +0200
commitd67b7daa1da67e7e02357dc8068a9f59e41be6e5 (patch)
treeb1f7da6ac4883d125ac65a2a5f6678e33bba7979 /src
parent2ab70cf0c6373a1457565c8fd99c442dbec7ee14 (diff)
downloadbison-d67b7daa1da67e7e02357dc8068a9f59e41be6e5.tar.gz
style: scope reduction in lalr.c
* src/lalr.c (initialize_goto_follows): here.
Diffstat (limited to 'src')
-rw-r--r--src/lalr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lalr.c b/src/lalr.c
index 69fbd8c7..eb4a1e87 100644
--- a/src/lalr.c
+++ b/src/lalr.c
@@ -199,7 +199,6 @@ initialize_goto_follows (void)
{
goto_number **reads = xnmalloc (ngotos, sizeof *reads);
goto_number *edge = xnmalloc (ngotos, sizeof *edge);
- goto_number nedges = 0;
goto_follows = bitsetv_create (ngotos, ntokens, BITSET_FIXED);
@@ -212,6 +211,8 @@ initialize_goto_follows (void)
FOR_EACH_SHIFT (trans, j)
bitset_set (goto_follows[i], TRANSITION_SYMBOL (trans, j));
+ /* Gotos outgoing from DST. */
+ goto_number nedges = 0;
for (; j < trans->num; ++j)
{
symbol_number sym = TRANSITION_SYMBOL (trans, j);
@@ -229,7 +230,6 @@ initialize_goto_follows (void)
reads[i] = xnmalloc (nedges + 1, sizeof reads[i][0]);
memcpy (reads[i], edge, nedges * sizeof edge[0]);
reads[i][nedges] = END_NODE;
- nedges = 0;
}
}
if (trace_flag & trace_automaton)