reader: simplify the search of the start symbol

Suggested by Paul Eggert.

* src/reader.c (find_start_symbol): Don't check 'res', we know it is
not null.  That suffices to avoid the GCC warnings.
* bootstrap.conf: We don't need 'assume', which doesn't exist anyway.
This commit is contained in:
Akim Demaille
2018-08-15 21:03:47 +02:00
parent 1113522acb
commit 8bc4348cc7
2 changed files with 6 additions and 12 deletions

View File

@@ -729,17 +729,11 @@ static symbol *
find_start_symbol (void)
{
symbol_list *res = grammar;
for (;
res && symbol_is_dummy (res->content.sym);
res = res->next)
{
for (res = res->next;
res && res->content.sym;
res = res->next)
continue;
assume (res);
}
assume (res);
/* Skip all the possible dummy rules of the first rule. */
for (; symbol_is_dummy (res->content.sym); res = res->next)
/* Skip the LHS, and then all the RHS of the dummy rule. */
for (res = res->next; res->content.sym; res = res->next)
continue;
return res->content.sym;
}