multistart: check duplicates

* src/symlist.h, src/symlist.c (symbol_list_find_symbol)
(symbol_list_last): New.
(symbol_list_append): Use symbol_list_last.
* src/reader.c (grammar_start_symbols_add): Check and discard duplicates.
* tests/input.at (Duplicate %start symbol): New.
* tests/reduce.at (Bad start symbols): Add the multistart keyword.
This commit is contained in:
Akim Demaille
2020-11-22 11:19:48 +01:00
parent 7fe9205b9f
commit 5b19f91ccf
6 changed files with 137 additions and 15 deletions

View File

@@ -452,7 +452,7 @@ AT_CLEANUP
AT_SETUP([Bad start symbols])
m4_pushdef([AT_TEST],
[
[AT_BISON_OPTION_PUSHDEFS([$1])
AT_DATA([[input.y]],
[%%
$1
@@ -461,6 +461,7 @@ $1
AT_BISON_CHECK([[input.y]], 1, [],
[$2
])
AT_BISON_OPTION_POPDEFS([$1])
])
AT_TEST(