mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-10 12:53:03 +00:00
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:
@@ -17,7 +17,7 @@
|
||||
|
||||
# gnulib modules used by this package.
|
||||
gnulib_modules='
|
||||
argmatch assert assume
|
||||
argmatch assert
|
||||
calloc-posix close closeout config-h c-strcase
|
||||
configmake
|
||||
dirname
|
||||
|
||||
16
src/reader.c
16
src/reader.c
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user