From 2da399d15f8cc08ffaf196735802fa381a43566d Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 9 May 2020 17:02:32 +0200 Subject: [PATCH 01/10] yacc.c: restore ansi-c compatibility Reported by neok-m4700. https://github.com/akimd/bison/issues/37 * data/skeletons/yacc.c: Don't use // comments. --- data/skeletons/yacc.c | 2 +- src/parse-gram.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/skeletons/yacc.c b/data/skeletons/yacc.c index a790f6fa..a9f15c8d 100644 --- a/data/skeletons/yacc.c +++ b/data/skeletons/yacc.c @@ -1979,7 +1979,7 @@ yyerrorlab: yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ - // Pop stack until we find a state that shifts the error token. + /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; diff --git a/src/parse-gram.c b/src/parse-gram.c index a021e1aa..212e95d5 100644 --- a/src/parse-gram.c +++ b/src/parse-gram.c @@ -2705,7 +2705,7 @@ yyerrorlab: yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ - // Pop stack until we find a state that shifts the error token. + /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; From 2b63c54f5a14bb558ca1ef458a489f6e74b837b0 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 22 Mar 2020 15:04:47 +0100 Subject: [PATCH 02/10] style: minor fixes * examples/c/README.md: here. --- TODO | 11 +++++++++-- examples/c/README.md | 8 ++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index 38977790..006284eb 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,12 @@ -* Bison 3.6 +* Bison 3.7 +** Bistromathic +- Hitting tab on a line with a syntax error is ugly + +- Be robust to existing ~/.inputrc + +- How about not evaluating incomplete lines when the text is not finished + (as shells do). + ** Doc *** api.header.include @@ -31,7 +39,6 @@ enough. *** calc.at Stop hard-coding "Calc". Adjust local.at (look for FIXME). -* Bison 3.7 ** Counter example generation See https://github.com/akimd/bison/pull/15. diff --git a/examples/c/README.md b/examples/c/README.md index 0d8031c3..2eb60449 100644 --- a/examples/c/README.md +++ b/examples/c/README.md @@ -32,10 +32,10 @@ The calculator with precedence directives and location tracking. It uses Flex to generate the scanner. ## reccalc - recursive calculator with Flex and Bison -The example builds on top of the previous one to provide a reentrant parser. -Such parsers can be called concurrently in different threads, or even -recursively. To demonstrate this feature, expressions in parentheses are -tokenized as strings, and then recursively parsed from the parser. So +This example builds on top of the previous one to provide a reentrant +parser. Such parsers can be called concurrently in different threads, or +even recursively. To demonstrate this feature, expressions in parentheses +are tokenized as strings, and then recursively parsed from the parser. So `(((1)+(2))*((3)+(4)))` uses eight parsers, with a depth of four. ## pushcalc - calculator implemented with a push parser From 6525abdc839c1d9c0ac145b30c2143e2c35207a1 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Fri, 8 May 2020 17:34:07 +0200 Subject: [PATCH 03/10] build: also provide lzip compressed tarballs Suggested by Matias Fonzo . * cfg.mk: Post announcements to bison-announce. * configure.ac: Build lzip packages. * .travis.yml: Build only xz, we don't care about the other formats here. --- .travis.yml | 2 +- cfg.mk | 2 +- configure.ac | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e413f22..162b9487 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,7 @@ jobs: - ./bootstrap - ./configure --enable-gcc-warnings || { cat config.log && false; } - make -j2 - - make -j2 dist + - make -j2 dist-xz # Can help understanding why we get "dirty" tarballs. - git status - dist=$(echo bison*.xz) diff --git a/cfg.mk b/cfg.mk index 798d4592..e1547a05 100644 --- a/cfg.mk +++ b/cfg.mk @@ -51,7 +51,7 @@ gnulib_dir = $(srcdir)/gnulib bootstrap-tools = autoconf,automake,flex,gettext,gnulib announcement_Cc_ = \ - bug-bison@gnu.org, help-bison@gnu.org, bison-patches@gnu.org, \ + bug-bison@gnu.org, bison-announce@gnu.org, \ coordinator@translationproject.org update-copyright: update-b4-copyright update-package-copyright-year diff --git a/configure.ac b/configure.ac index 956ce4cd..edc05eb5 100644 --- a/configure.ac +++ b/configure.ac @@ -36,10 +36,8 @@ AC_DEFINE_UNQUOTED([PACKAGE_COPYRIGHT_YEAR], [$PACKAGE_COPYRIGHT_YEAR], AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) -# We use Automake 1.14's %D% and %C%. -# # When we move to Automake 1.16, simplify examples/c/reccalc/local.mk. -# Our CI runs on Xenial, which has only Automake 1.15. +# Our CI build the packages on Bionic, which has only Automake 1.15. # # We want gnits strictness only when rolling a stable release. For # release candidates, we use version strings like 2.4.3_rc1, but gnits @@ -47,7 +45,7 @@ AC_CONFIG_MACRO_DIR([m4]) # releases, we want to be able run make dist without being required to # add a bogus NEWS entry. In that case, the version string # automatically contains a dash, which we also let disable gnits. -AM_INIT_AUTOMAKE([1.14 dist-xz nostdinc +AM_INIT_AUTOMAKE([1.15 dist-lzip dist-xz nostdinc color-tests parallel-tests silent-rules] m4_bmatch(m4_defn([AC_PACKAGE_VERSION]), [[-_]], From c3585f41efa1e5dc8ce41c800fe2963ae66c09ab Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 10 May 2020 08:20:30 +0200 Subject: [PATCH 04/10] examples: beware of ~/.inputrc * examples/c/bistromathic/bistromathic.test: here. --- NEWS | 3 +++ examples/c/bistromathic/README.md | 3 +++ examples/c/bistromathic/bistromathic.test | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/NEWS b/NEWS index 21937f12..31df56c5 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ GNU Bison NEWS * Noteworthy changes in release ?.? (????-??-??) [?] +** Bug fixes + + GNU readline portability issues. * Noteworthy changes in release 3.6 (2020-05-08) [stable] diff --git a/examples/c/bistromathic/README.md b/examples/c/bistromathic/README.md index 05f1b7ed..6b66299e 100644 --- a/examples/c/bistromathic/README.md +++ b/examples/c/bistromathic/README.md @@ -14,6 +14,9 @@ This example demonstrates best practices when using Bison. - It supports debug traces with semantic values. - It uses named references instead of the traditional $1, $2, etc. +To customize the interaction with bistromathic, see the GNU Readline user +manual (see `info rluserman`). +