summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* maint: remove unnecessary casts before using gnulib functionsHEADmasterEdoardo Sanguineti2022-11-043-5/+5
| | | | | | | | * src/parse-gram.y, src/scan-gram.l: Do not cast c-ctype.h function args to unsigned char unnecessarily. * src/parse-gram.c: Regenerate. Copyright-paperwork-exempt: yes
* cex: check -Dcex.timeoutAkim Demaille2022-09-202-3/+48
| | | | | | | * src/counterexample.c (counterexample_init): Remove stray debug trace. Complain about invalid values. * tests/input.at (-Dcex.timeout): New.
* news: updateAkim Demaille2022-09-201-4/+11
| | | | * NEWS: update.
* d: fix syntax error on SymbolKind.toString methodAdela Vais2022-09-201-3/+2
| | | | | | | Reported by ledaniel2. <https://github.com/akimd/bison/issues/88> * data/skeletons/d.m4: Here.
* d: fix interface syntax errorAdela Vais2022-09-202-2/+10
| | | | | | | | | | | Fix syntax error regarding interface inheritance of the Lexer. It appeared when the `%code lexer` option was used. Reported by ledaniel2. <https://github.com/akimd/bison/issues/84> * data/skeletons/lalr1.d: Fix syntax. * tests/d.at: Test it.
* cex: provide the user with a means to change the timeoutAkim Demaille2022-09-169-18/+48
| | | | | | | | | | | | | Reported by Frank Heckenbach. https://lists.gnu.org/r/bug-bison/2022-07/msg00011.html * bootstrap.conf: Use c_strtod, so that even in French locales "1.5" is accepted, instead of "1,5". * src/counterexample.c, src/state-item.c: Use xtime_t instead of time_t, so that accuracy goes from seconds to nanoseconds. ( counterexample_init): Depend on cex.timeout rather than $TIME_LIMIT. * doc/bison.texi (%define Summary): Document cex.timeout.
* doc: define the syntax of named referencesAkim Demaille2022-09-121-1/+6
| | | | | | | | Reported by Arthur Schwarz. https://lists.gnu.org/r/help-bison/2022-06/msg00007.html * doc/bison.texi (Named References): Define the syntax of named references.
* cex: clarify messageAkim Demaille2022-09-101-1/+1
| | | | | | | | Reported by Frank Heckenbach. https://lists.gnu.org/r/bug-bison/2022-07/msg00007.html src/counterexample.c (unifying_example): Prefer "searching for" to "finding", which is somewhat confusing.
* doc: fix the description of the syntax of %token and %leftAkim Demaille2022-09-101-5/+17
| | | | | | | Reported by Frank Heckenbach. https://lists.gnu.org/r/bug-bison/2022-07/msg00007.html * doc/bison.texi (Symbol Decls): here.
* reader: reject rules on YYEOFAkim Demaille2022-09-102-0/+36
| | | | | | | | | | We crashed when rules were given on YYEOF. Reported by Han Zheng. Fixes https://github.com/akimd/bison/issues/92. * src/reader.c (check_and_convert_grammar): Make sure YYEOF is not an nterm. * tests/input.at (Rule for YYEOF): New.
* gnulib: updateAkim Demaille2022-09-102-0/+2
|
* muscles: fix handling of the "@'" escapeAkim Demaille2022-09-042-4/+20
| | | | | | | | | | | | | | | When we use `b4_` or `m4_` somewhere in the input, it is escaped as `b4@'_`/`m4@'_` so that the warning about unexpanded b4_foo/m4_foo macros does not fire. But in the case of muscles, the `@'` escape was not recognized, and an assertion was triggered. Reported by Han Zheng. <https://github.com/akimd/bison/issues/91> * src/muscle-tab.c (COMMON_DECODE): Handle `@'`. * tests/skeletons.at (Suspicious sequences): Check that case.
* c++: enable C++11 assignment operators for lalr1.ccAnthony Heading2022-09-032-6/+8
| | | | | | | | <https://github.com/akimd/bison/pull/85> <https://lists.gnu.org/r/bug-bison/2022-04/msg00000.html> * data/skeletons/c++.m4: Enable C++11 assignment operators for all C++ skeletons.
* tests: ignore messages from the JVMAkim Demaille2022-09-032-3/+7
| | | | | | | Reported by Giorgos Pap. <https://lists.gnu.org/r/bug-bison/2022-08/msg00002.html> * examples/test: Discard "Picked up _JAVA_OPTIONS:" messages.
* diagnostics: Windows compatibility issuesAkim Demaille2022-09-032-4/+5
| | | | | | | | | | Suggested by Bruno Haible <https://lists.gnu.org/r/bug-bison/2022-08/msg00006.html> following a report from Andrei Malashkin <https://lists.gnu.org/r/bug-bison/2022-08/msg00003.html> * src/location.c (caret_set_file): Read the file in binary. We already deal with CRLF in caret_getc_internal.
* regenAkim Demaille2022-08-022-8/+8
|
* yacc.c, lalr1.cc: fix warnings about yynerrsAkim Demaille2022-08-023-4/+5
| | | | | | | | | | | | | | | | | | | | Most often yynerrs is not used. Clang 15 now complains about such variables. Bison itself does not compile: ``` src/parse-gram.c:1797:9: error: variable 'gram_nerrs' set but not used [-Werror,-Wunused-but-set-variable] int yynerrs = 0; ^ src/parse-gram.c:79:25: note: expanded from macro 'yynerrs' ^ 1 error generated. ``` Reported by Nikita Popov. Fixes https://github.com/akimd/bison/issues/89. * data/skeletons/yacc.c (yynerrs): Flag with YY_ATTRIBUTE_UNUSED. * data/skeletons/lalr1.cc (yynerrs_): Likewise.
* glr2.cc: fix -Wnoexcept issuesAkim Demaille2022-08-011-2/+2
| | | | | | | | | | | | | | | | | | | | 440-453 and 685 failed with GCC 12.1: ``` test.cc:1814:21: required from here /opt/local/include/gcc12/c++/bits/stl_construct.h:95:14: error: noexcept-expression evaluates to 'false' because of a call to '{anonymous}::glr_stack_item::glr_stack_item(bool)' [-Werror=noexcept] 95 | noexcept(noexcept(::new((void*)0) _Tp(std::declval<_Args>()...))) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ test.cc:1486:5: note: but '{anonymous}::glr_stack_item::glr_stack_item(bool)' does not throw; perhaps it should be declared 'noexcept' 1486 | glr_stack_item (bool state = true) | ^~~~~~~~~~~~~~ ``` Reported by Paul Eggert. <https://lists.gnu.org/r/bison-patches/2022-07/msg00008.html> * data/skeletons/glr2.cc (glr_state, glr_stack_item): Declare the default ctors noexcept.
* lalr1.cc: declare stack_symbol_type as noexceptAkim Demaille2022-08-011-2/+2
| | | | | | | | | | | | | | | | | | | | | Many C++ tests (400-25, 440-53, 664-5, 667-76, 679-80, 682-3, 685-9, 692) failed with GCC 12.1: ``` test.cc:843:28: required from here /opt/local/include/gcc12/c++/bits/stl_construct.h:95:14: error: noexcept-expression evaluates to 'false' because of a call to 'yy::parser::stack_symbol_type::stack_symbol_type()' [-Werror=noexcept] 95 | noexcept(noexcept(::new((void*)0) _Tp(std::declval<_Args>()...))) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ test.cc:990:3: note: but 'yy::parser::stack_symbol_type::stack_symbol_type()' does not throw; perhaps it should be declared 'noexcept' 990 | parser::stack_symbol_type::stack_symbol_type () | ^~~~~~ ``` Reported by Paul Eggert. <https://lists.gnu.org/r/bison-patches/2022-07/msg00008.html> * data/skeletons/lalr1.cc (stack_symbol_type::stack_symbol_type()): Declare noexcept.
* maint: update .gitignore for GnulibPaul Eggert2022-07-312-0/+2
|
* maint: don’t use \] in BREs and EREsPaul Eggert2022-07-314-7/+7
| | | | | | | | | * .travis.yml (jobs): * doc/local.mk ($(top_srcdir)/%D%/bison.help): * tests/regression.at (Web2c Actions, Useless Tokens): * tests/scanner.at (Token numbers: $1): Use plain ], not \], in a POSIX regular expression, as POSIX says the interpretation of \] is undefined.
* maint: improve Gnulib checkingPaul Eggert2022-07-311-0/+10
| | | | | * configure.ac: With --enable-gcc-warnings, #define lint, _FORTIFY_SOURCE, and GNULIB_PORT_CHECK, to better check Gnulib.
* maint: don’t get fdl.texi from GnulibPaul Eggert2022-07-313-2/+506
| | | | | | | | This reverses the 2012-01-13T09:39:45Tmeyering@redhat.com patch, as Gnulib’s fdl.texi module now says “Don't use this module!” * bootstrap.conf (gnulib_modules): Remove fdl. * doc/.gitignore: Don’t ignore fdl.texi. * doc/fdl.texi: New file, copied from Gnulib.
* gnulib: updatePaul Eggert2022-07-311-0/+0
|
* style: enforce GNU-style variable namesAkim Demaille2022-07-312-22/+22
| | | | | | * examples/c/glr/c++-types.y, tests/cxx-type.at (lineNum, colNum): Rename as... (line_num, col_num): these.
* tests: avoid useless variablesAkim Demaille2022-07-312-14/+15
| | | | | | | | Reported by clang's -Wunused-but-set-variable warning. * configure.ac (warn_common): Add -Wunused-but-set-variable. * tests/cxx-type.at: Don't emit location track code when we don't use locations.
* gnulib: updateAkim Demaille2022-07-312-1/+1
| | | | | We now build cleanly even if libtextstyle is not available. See https://lists.gnu.org/r/bug-bison/2022-07/msg00002.html.
* gnulib: updateAkim Demaille2022-07-316-1009/+1457
| | | | | There are now new files to track. See <https://lists.gnu.org/r/bug-gnulib/2022-07/msg00053.html>.
* address unused variablesAkim Demaille2022-07-312-10/+4
| | | | | | | Reported by recent versions of clang. * src/counterexample.c (search_state_prepend): Use complexity_cost. * src/print.c: Remove useless variable.
* doc: explain why location's "column" are defined vaguelyAkim Demaille2022-06-154-5/+79
| | | | | | | | | | | | | Suuggested by Frank Heckenbach. <https://lists.gnu.org/r/bug-bison/2022-01/msg00000.html> * doc/bison.texi (Location Type): Explain why location's "column" are defined vaguely. Show tab handling in ltcalc and calc++. * examples/c/bistromathic/parse.y: Show tab handling. * examples/c++/calc++/calc++.test, * examples/c/bistromathic/bistromathic.test: Check tab handling.
* gnulib: updateAkim Demaille2022-06-152-4/+5
|
* gnulib: updateAkim Demaille2022-01-233-3/+21
|
* doc: improve calling-convention docPaul Eggert2022-01-151-12/+43
| | | | | | | * doc/bison.texi (Calling Convention, Error Reporting Function): Suggest ‘%code provides’ to declare yylex and yyerror. Prompted by this email thread: https://lists.gnu.org/r/bug-bison/2022-01/msg00002.html
* package: bump copyrights to 2022Paul Eggert2022-01-15255-264/+264
| | | | Run "make update-copyright".
* gnulib: make use of gnulib-tool's --automake-subdir optionBruno Haible2021-12-193-7/+1
| | | | | | | Starting this week, Gnulib supports generating a "non-recursive" Automake Makefile.am snippet https://lists.gnu.org/r/bug-gnulib/2021-12/msg00085.html. * bootstrap.conf: Use gnulib-tool's --automake-subdir.
* gnulib: updateAkim Demaille2021-12-193-110/+111
| | | | To get native non-recursive make support.
* doc: add indexesAkim Demaille2021-12-191-0/+3
| | | | * doc/bison.texi (Special Tokens): here.
* warnings: don't complain about m4_foo and b4_foo when from the userAkim Demaille2021-11-076-25/+94
| | | | | | | | | | | | | | | | | | | | | | Currently, occurrences of these identifiers in the user's input yield spurious warnings. To tell the difference between a legitimate m4_foo from the user, and a bad m4_foo coming from a non-evaluated macro of a skeleton, escape the user's identifiers as m4@'_foo. We already use @' as a special sequence to be stripped from the skeleton's output. See <https://lists.gnu.org/r/bug-bison/2021-10/msg00026.html> and previous commit ("warnings: be less picky about occurrences of m4_/b4_ in the output"). * src/flex-scanner.h (OBSTACK_SGROW): New. * src/output.c (output_escaped): Escape m4_ and b4_. * src/scan-code.l: Likewise. * src/system.h (obstack_escape): Likewise. And rewrite as a function. * tests/skeletons.at (Suspicious sequences): Make sure the user can use m4_foo/b4_foo without spurious warnings.
* warnings: be less picky about occurrences of m4_/b4_ in the outputAkim Demaille2021-11-063-2/+47
| | | | | | | | Reported by Marko Mäkelä. <https://lists.gnu.org/r/bug-bison/2021-10/msg00026.html> * src/scan-skel.l: It is ok to have foob4_ or foom4_. * tests/skeletons.at (Suspicious sequences): New.
* gnulib: updateAkim Demaille2021-11-061-0/+0
|
* tests: address portability issues about strdupAkim Demaille2021-11-065-4/+23
| | | | | | | | | | | | | Reported by Dennis Clarke <https://lists.gnu.org/r/bug-bison/2021-10/msg00005.html>. In particular <https://lists.gnu.org/r/bug-bison/2021-10/msg00023.html>. * doc/bison.texi, examples/c/glr/c++-types.y, * examples/c/bistromathic/parse.y tests/testsuite.h: Define _XOPEN_SOURCE to 600, to get a strdup that works on Solaris. * tests/glr-regression.at: Use strdup freely.
* tests: fix coding styleAkim Demaille2021-11-062-44/+40
| | | | | | * tests/cxx-type.at, tests/glr-regression.at: Prefer strdup to malloc+strcpy. Use snake_case.
* examples: fix coding styleAkim Demaille2021-11-062-41/+38
| | | | | * examples/c/glr/c++-types.y: Use snake_case identifiers. Prefer strdup to malloc+strcpy.
* build: check -Wsubobject-linkage in C++Akim Demaille2021-10-112-1/+6
| | | | * configure.ac (warn_cxx): here.
* tests: make it easier to spot failuresAkim Demaille2021-10-091-11/+26
| | | | * examples/c/glr/c++-types.test: Split in several small test cases.
* maint: post-release administriviaAkim Demaille2021-09-252-1/+4
| | | | | | * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
* version 3.8.2v3.8.2Akim Demaille2021-09-251-1/+1
| | | | * NEWS: Record release date.
* tests: Apple clang issues warning on C++11 featuresAkim Demaille2021-09-252-1/+11
| | | | | | | | | | | | | | | | | | | | $ cat /tmp/foo.cc using foo = int; foo f; $ clang++ -Wc++11-extensions -c /tmp/foo.cc /tmp/foo.cc:1:13: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using foo = int; ^ 1 warning generated. $ clang++ --version Apple clang version 11.0.0 (clang-1100.0.33.17) Target: x86_64-apple-darwin18.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin * tests/local.at (AT_COMPILE_CXX): Make sure -std=c++11 is passed when running glr2.cc. It may be overridden by another flag in CXXFLAGS afterwards.
* avoid using atoiAkim Demaille2021-09-254-9/+18
| | | | | | * cfg.mk: Disable sc_indent as auto indent is too invasive for now. Enable sc_prohibit_atoi_atof, except where we don't care. * src/location.c, src/muscle-tab.c: Use strtol instead of atoi.
* news: updateAkim Demaille2021-09-241-0/+4
|