mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-16 15: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 used by this package.
|
||||||
gnulib_modules='
|
gnulib_modules='
|
||||||
argmatch assert assume
|
argmatch assert
|
||||||
calloc-posix close closeout config-h c-strcase
|
calloc-posix close closeout config-h c-strcase
|
||||||
configmake
|
configmake
|
||||||
dirname
|
dirname
|
||||||
|
|||||||
16
src/reader.c
16
src/reader.c
@@ -729,17 +729,11 @@ static symbol *
|
|||||||
find_start_symbol (void)
|
find_start_symbol (void)
|
||||||
{
|
{
|
||||||
symbol_list *res = grammar;
|
symbol_list *res = grammar;
|
||||||
for (;
|
/* Skip all the possible dummy rules of the first rule. */
|
||||||
res && symbol_is_dummy (res->content.sym);
|
for (; symbol_is_dummy (res->content.sym); res = res->next)
|
||||||
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)
|
||||||
for (res = res->next;
|
continue;
|
||||||
res && res->content.sym;
|
|
||||||
res = res->next)
|
|
||||||
continue;
|
|
||||||
assume (res);
|
|
||||||
}
|
|
||||||
assume (res);
|
|
||||||
return res->content.sym;
|
return res->content.sym;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user