style: comment and names changes in map_goto

* src/lalr.h, src/lalr.c: Use clearer names.
This commit is contained in:
Akim Demaille
2019-02-10 13:38:17 +01:00
parent e42a7a1862
commit fb83319d9c
2 changed files with 5 additions and 5 deletions

View File

@@ -122,7 +122,7 @@ set_goto_map (void)
goto_number
map_goto (state_number s0, symbol_number sym)
map_goto (state_number src, symbol_number sym)
{
goto_number low = goto_map[sym - ntokens];
goto_number high = goto_map[sym - ntokens + 1] - 1;
@@ -132,9 +132,9 @@ map_goto (state_number s0, symbol_number sym)
aver (low <= high);
goto_number middle = (low + high) / 2;
state_number s = from_state[middle];
if (s == s0)
if (s == src)
return middle;
else if (s < s0)
else if (s < src)
low = middle + 1;
else
high = middle - 1;

View File

@@ -96,8 +96,8 @@ extern state_number *from_state;
/** State number it leads to. */
extern state_number *to_state;
/** Find the goto number of the goto from S on non-terminal SYM. */
goto_number map_goto (state_number s, symbol_number sym);
/** The number of the goto from state SRC labeled with nterm SYM. */
goto_number map_goto (state_number src, symbol_number sym);
/* goto_follows[i] is the set of tokens following goto i. */
extern bitsetv goto_follows;