mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-09 18:55:14 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69b22b49d4 | ||
|
|
ec11f08fb3 | ||
|
|
67444a6f0d | ||
|
|
d120a07e6b | ||
|
|
741a58a504 | ||
|
|
d80815ac23 | ||
|
|
0b417c3479 | ||
|
|
77dbdd0d59 | ||
|
|
f8db8fe4d7 | ||
|
|
375eb71489 | ||
|
|
d3a86f7b20 | ||
|
|
29c75ef27f | ||
|
|
628012d830 | ||
|
|
f788ba2ab6 | ||
|
|
53526f31df | ||
|
|
e63811dd86 | ||
|
|
47262c36bb | ||
|
|
1e452b1553 | ||
|
|
ed796869bb | ||
|
|
12c412f6bb | ||
|
|
2663035ea5 | ||
|
|
de7c66ab41 | ||
|
|
feeacc2d57 | ||
|
|
cc10f9ab24 | ||
|
|
1dcd6068dd | ||
|
|
02f16dc799 | ||
|
|
aa21c457f2 | ||
|
|
9f26e6d6b3 | ||
|
|
8d3e782e05 | ||
|
|
1c671bad33 | ||
|
|
88cd9570b6 | ||
|
|
c423ad17e7 | ||
|
|
9114b267a8 | ||
|
|
70c3f3ade5 | ||
|
|
1934304acf | ||
|
|
c8e57e8159 | ||
|
|
1e49f5e1e6 | ||
|
|
49aae94bed | ||
|
|
e191bf7b9f |
+1
-1
@@ -1 +1 @@
|
||||
3.3.91
|
||||
3.4.1
|
||||
|
||||
+91
-67
@@ -1,8 +1,7 @@
|
||||
# Travis defines and exports CC and CXX *after* we have defined our
|
||||
# environment variables via 'env'. So, do not use 'env' to define
|
||||
# them. Instead, put their definitions in MATRIX_EVAL, which we eval
|
||||
# after the definitions from Travis.
|
||||
|
||||
# environment variables via 'env'. So, do not use 'env' to define them.
|
||||
# Instead, put their definitions in MATRIX_EVAL, which we eval after the
|
||||
# definitions from Travis.
|
||||
language: cpp
|
||||
|
||||
env:
|
||||
@@ -21,13 +20,20 @@ stages:
|
||||
- compile
|
||||
- test
|
||||
|
||||
# matrix.include and jobs.include are aliases (https://docs.travis-ci.com/user/conditional-builds-stages-jobs/).
|
||||
# The 'test' jobs do not need the repo at all, only the 'compile'
|
||||
# does. Let's save time, bandwith, energy, and polar bears.
|
||||
git:
|
||||
clone: false
|
||||
|
||||
# matrix.include and jobs.include are aliases
|
||||
# (https://docs.travis-ci.com/user/conditional-builds-stages-jobs/).
|
||||
jobs:
|
||||
include:
|
||||
- stage: "compile"
|
||||
dist: xenial
|
||||
git:
|
||||
clone: true
|
||||
dist: bionic
|
||||
script:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq autoconf automake autopoint flex gettext graphviz help2man m4 texinfo
|
||||
- autoconf --version
|
||||
- automake --version
|
||||
@@ -37,29 +43,29 @@ jobs:
|
||||
- help2man --version
|
||||
- makeinfo --version
|
||||
- m4 --version
|
||||
- git tag -l
|
||||
# For some reasons, sometimes the checkout does not have any tags,
|
||||
# so `git describe` fails, so bootstrap fails.
|
||||
- git describe || git tag v3.0 -m "Fake version 3.0."
|
||||
- git describe
|
||||
|
||||
# Appears to be needed for the following command (https://github.com/AppImage/AppImageKit/issues/511).
|
||||
- git submodule sync
|
||||
# Travis makes a shallow clone, but we need it in full to build the ChangeLog and apply the fixes in git-log-fix.
|
||||
- git fetch --unshallow || true
|
||||
- git submodule update --init --recursive
|
||||
|
||||
- ./bootstrap
|
||||
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
|
||||
- ./configure --enable-gcc-warnings CC="$CC" CXX="$CXX" $CONFIGUREFLAGS || { cat config.log && false; }
|
||||
# gnulib-po/Makefile.in.in is about Gettext 0.20, which is not available in bionic. So it will break here. Override it. Don't use autopoint, which sends some other files in the past.
|
||||
- cp po/Makefile.in.in gnulib-po
|
||||
|
||||
- ./configure --enable-gcc-warnings || { cat config.log && false; }
|
||||
- make -j2
|
||||
- make -j2 dist
|
||||
- dist=$(echo bison*.xz)
|
||||
|
||||
# Unfortunately we cannot deterministically know the name of the tarball without the full
|
||||
# git history (because git describe --abbrev=4 may use more than 4 characters if there are
|
||||
# conflicts). Besides, one day we would like not to depend on the repository at all in the
|
||||
# 'test' jobs. So also expose this tarball on a name that only depends on the Travis build
|
||||
# number.
|
||||
- sftp [email protected] <<< "put $dist"$'\n'"ln -s $dist bison-$TRAVIS_BUILD_NUMBER.tar.xz"
|
||||
# conflicts).
|
||||
#
|
||||
# So for the sake of the 'test' jobs (that don't even have the repo at all), also expose this
|
||||
# tarball on a name that only depends on the Travis build number.
|
||||
#
|
||||
# Without -b -, exit status is always 0.
|
||||
- sftp -b - [email protected] <<< "put $dist"$'\n'"ln -s $dist bison-$TRAVIS_BUILD_NUMBER.tar.xz"
|
||||
|
||||
## ------- ##
|
||||
## First. ##
|
||||
@@ -68,57 +74,52 @@ jobs:
|
||||
# Start with three completely different environments, to get
|
||||
# errors asap.
|
||||
|
||||
- name: "GCC 7 -O3"
|
||||
- name: "GCC 8 -O3"
|
||||
stage: test
|
||||
os: linux
|
||||
dist: xenial
|
||||
dist: bionic
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-7
|
||||
- g++-8
|
||||
env:
|
||||
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'"
|
||||
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8 && CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'"
|
||||
|
||||
# ASAN is time consuming, and we timeout the 50min granted by
|
||||
# Travis if we run all the tests in one go. Run in two parts.
|
||||
- name: "Clang 7 libc++ and ASAN part 1"
|
||||
- name: "Clang 8 libc++ and ASAN part 1"
|
||||
stage: test
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
dist: bionic
|
||||
addons: &clang8
|
||||
apt:
|
||||
sources:
|
||||
- llvm-toolchain-xenial-7
|
||||
- llvm-toolchain-bionic-8
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- clang-7
|
||||
- libc++-7-dev
|
||||
- libc++abi-7-dev
|
||||
- clang-8
|
||||
- libc++-8-dev
|
||||
- libc++abi-8-dev
|
||||
env:
|
||||
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
||||
- MATRIX_EVAL="PART=1 CC='clang-7 -fsanitize=address' CXX='clang++-7 -fsanitize=address -stdlib=libc++'"
|
||||
- MATRIX_EVAL="PART=1 CC='clang-8 -fsanitize=address' CXX='clang++-8 -fsanitize=address -stdlib=libc++'"
|
||||
|
||||
- name: "Clang 7 libc++ and ASAN part 2"
|
||||
- name: "Clang 8 libc++ and ASAN part 2"
|
||||
stage: test
|
||||
os: linux
|
||||
dist: xenial
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- llvm-toolchain-xenial-7
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- clang-7
|
||||
- libc++-7-dev
|
||||
- libc++abi-7-dev
|
||||
dist: bionic
|
||||
addons: *clang8
|
||||
env:
|
||||
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
||||
- MATRIX_EVAL="PART=2 CC='clang-7 -fsanitize=address' CXX='clang++-7 -fsanitize=address -stdlib=libc++'"
|
||||
- MATRIX_EVAL="PART=2 CC='clang-8 -fsanitize=address' CXX='clang++-8 -fsanitize=address -stdlib=libc++'"
|
||||
|
||||
- name: "ICC"
|
||||
stage: test
|
||||
# We need the build-aux/install-icc.sh script.
|
||||
git:
|
||||
clone: true
|
||||
submodules: false
|
||||
depth: 1
|
||||
os: linux
|
||||
dist: xenial
|
||||
env:
|
||||
@@ -133,23 +134,27 @@ jobs:
|
||||
## GCC. ##
|
||||
## ----- ##
|
||||
|
||||
#- name: "GCC 8 with sanitizers"
|
||||
# os: linux
|
||||
# dist: xenial
|
||||
# addons:
|
||||
# apt:
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
# packages:
|
||||
# - g++-8
|
||||
# env:
|
||||
# # Can't use UBSAN: I get:
|
||||
# # configure:4951: gcc-8 -fsanitize=undefined,address -fno-omit-frame-pointer conftest.c
|
||||
# # /usr/bin/ld: unrecognized option '--push-state' (on trusty)
|
||||
# # /usr/bin/ld: unrecognized option '--push-state--no-as-needed' (on xenial)
|
||||
# #
|
||||
# # https://stackoverflow.com/questions/50024731/ suggests using the gold linker.
|
||||
# - MATRIX_EVAL="CC='gcc-8 -fsanitize=undefined,address -fno-omit-frame-pointer' CXX='g++-8 -fsanitize=undefined,address -fno-omit-frame-pointer'"
|
||||
- name: "GCC 7 with sanitizers"
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-7
|
||||
env:
|
||||
- MATRIX_EVAL="CC='gcc-7 -fsanitize=undefined,address -fno-omit-frame-pointer' CXX='g++-7 -fsanitize=undefined,address -fno-omit-frame-pointer'"
|
||||
- PART=1
|
||||
|
||||
- name: "GCC 7"
|
||||
stage: test
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-7
|
||||
env:
|
||||
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
|
||||
|
||||
- name: "GCC 6"
|
||||
stage: test
|
||||
@@ -233,6 +238,23 @@ jobs:
|
||||
## Clang. ##
|
||||
## ------- ##
|
||||
|
||||
- name: "Clang 7 -O3 and libc++"
|
||||
stage: test
|
||||
os: linux
|
||||
dist: bionic
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- llvm-toolchain-bionic-7
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- clang-7
|
||||
- libc++-7-dev
|
||||
- libc++abi-7-dev
|
||||
env:
|
||||
- MATRIX_EVAL="CC=clang-7 && CXX='clang++-7 -stdlib=libc++'"
|
||||
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
||||
|
||||
- name: "Clang 6 -O3 and libc++"
|
||||
stage: test
|
||||
os: linux
|
||||
@@ -375,7 +397,7 @@ jobs:
|
||||
## From https://docs.gitlab.com/ce/ci/ssh_keys/#ssh-keys-when-using-the-docker-executor.
|
||||
## Applies to Travis too. Applied to all the 'script's (of all the jobs).
|
||||
before_script:
|
||||
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
|
||||
- 'which ssh-agent || ( sudo apt-get install openssh-client -y )'
|
||||
- eval "$(ssh-agent -s)"
|
||||
# $SSH_PRIVATE_KEY is multiline. Use $'...' to register its value: $'-----BEGIN OPENSSH PRIVATE KEY-----\nXXXXX...\n...==\n-----END OPENSSH PRIVATE KEY-----'.
|
||||
- echo "$SSH_PRIVATE_KEY" >/tmp/key.id_rsa
|
||||
@@ -391,7 +413,6 @@ script:
|
||||
- eval "$MATRIX_EVAL"
|
||||
# Beware not too leak $SSH_PRIVATE_KEY.
|
||||
# - env
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq doxygen flex m4
|
||||
# Install and activate ICC.
|
||||
- if [[ $CC == "icc" ]]; then build-aux/install-icc.sh; fi
|
||||
@@ -413,6 +434,9 @@ script:
|
||||
# with `Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m`, which makes
|
||||
# the test suite fail.
|
||||
- unset _JAVA_OPTIONS
|
||||
|
||||
# Fail fast from now on.
|
||||
- set -e
|
||||
- sftp [email protected]:bison-$TRAVIS_BUILD_NUMBER.tar.xz
|
||||
- tar xf bison-$TRAVIS_BUILD_NUMBER.tar.xz
|
||||
- dir=$(tar tf bison-$TRAVIS_BUILD_NUMBER.tar.xz | sed 1q)
|
||||
@@ -422,8 +446,8 @@ script:
|
||||
- ../configure --enable-gcc-warnings CC="$CC" CXX="$CXX" $CONFIGUREFLAGS || { cat config.log && false; }
|
||||
- make -j2 $MAKE_ARGS
|
||||
- if test ${PART-1} = 1; then make check VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat test-suite.log && cat tests/testsuite.log && false; }; fi
|
||||
- if test ${PART-1} = 1; then make maintainer-check-posix VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
|
||||
- if test ${PART-2} = 2; then make maintainer-check-posix VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
|
||||
- if test ${PART-2} = 2; then make maintainer-check-g++ VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
|
||||
|
||||
after_script:
|
||||
- if [[ $CC == "icc" ]]; then uninstall_intel_software; fi
|
||||
- uninstall_intel_software || true
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
GNU Bison NEWS
|
||||
|
||||
* Noteworthy changes in release 3.4.2 (2019-09-12) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
In some cases, when warnings are disabled, bison could emit tons of white
|
||||
spaces as diagnostics.
|
||||
|
||||
When running out of memory, bison could crash (found by fuzzing).
|
||||
|
||||
When defining twice the EOF token, bison would crash.
|
||||
|
||||
New warnings from recent compilers have been addressed in the generated
|
||||
parsers (yacc.c, glr.c, glr.cc).
|
||||
|
||||
When lone carriage-return characters appeared in the input file,
|
||||
diagnostics could hang forever.
|
||||
|
||||
* Noteworthy changes in release 3.4.1 (2019-05-22) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
Portability fixes.
|
||||
|
||||
* Noteworthy changes in release 3.4 (2019-05-19) [stable]
|
||||
|
||||
** Deprecated features
|
||||
|
||||
@@ -89,15 +89,18 @@ Jonathan Fabrizio [email protected]
|
||||
Jonathan Nieder [email protected]
|
||||
Josh Soref [email protected]
|
||||
Juan Manuel Guerrero [email protected]
|
||||
Karl Berry [email protected]
|
||||
Kees Zeelenberg [email protected]
|
||||
Keith Browne [email protected]
|
||||
Ken Moffat [email protected]
|
||||
Kiyoshi Kanazawa [email protected]
|
||||
Laurent Mascherpa [email protected]
|
||||
László Várady [email protected]
|
||||
Lie Yan [email protected]
|
||||
Magnus Fromreide [email protected]
|
||||
Marc Autret [email protected]
|
||||
Marc Mendiola [email protected]
|
||||
Marc Schönefeld [email protected]
|
||||
Mark Boyall [email protected]
|
||||
Martin Jacobs [email protected]
|
||||
Martin Mokrejs [email protected]
|
||||
@@ -118,6 +121,7 @@ Mike Sullivan [email protected]
|
||||
Nate Guerin [email protected]
|
||||
Neil Booth [email protected]
|
||||
Nelson H. F. Beebe [email protected]
|
||||
neok m4700 [email protected]
|
||||
Nick Bowler [email protected]
|
||||
Nicolas Bedon [email protected]
|
||||
Nicolas Burrus [email protected]
|
||||
@@ -179,7 +183,7 @@ Tom Tromey [email protected]
|
||||
Tommy Nordgren [email protected]
|
||||
Troy A. Johnson [email protected]
|
||||
Tys Lefering [email protected]
|
||||
Uxio Prego uxio[email protected]
|
||||
Uxio Prego uxio@uma.es
|
||||
Valentin Tolmer [email protected]
|
||||
wcventure [email protected]
|
||||
Victor Khomenko [email protected]
|
||||
@@ -196,6 +200,7 @@ Wwp [email protected]
|
||||
xolodho [email protected]
|
||||
Zack Weinberg [email protected]
|
||||
長田偉伸 [email protected]
|
||||
江 祖铭 [email protected]
|
||||
|
||||
Many people are not named here because we lost track of them. We
|
||||
thank them! Please, help us keeping this list up to date.
|
||||
|
||||
+2
-1
@@ -25,7 +25,7 @@ gnulib_modules='
|
||||
error extensions fdl fopen-safer
|
||||
getopt-gnu
|
||||
gettext-h git-version-gen gitlog-to-changelog
|
||||
gpl-3.0 hash inttypes isnan javacomp-script
|
||||
gpl-3.0 inttypes isnan javacomp-script
|
||||
javaexec-script
|
||||
ldexpl
|
||||
libtextstyle-optional
|
||||
@@ -48,6 +48,7 @@ gnulib_modules='
|
||||
xalloc
|
||||
xalloc-die
|
||||
xconcat-filename
|
||||
xhash
|
||||
xlist
|
||||
xmemdup0
|
||||
xstrndup
|
||||
|
||||
@@ -215,6 +215,7 @@ $LEX_IS_FLEX || test "X$LEX" = X: || {
|
||||
AC_MSG_WARN([bypassing lex because flex is required])
|
||||
LEX=:
|
||||
}
|
||||
AM_CONDITIONAL([FLEX_WORKS], [$LEX_IS_FLEX])
|
||||
AM_CONDITIONAL([FLEX_CXX_WORKS],
|
||||
[$LEX_IS_FLEX && test $bison_cv_cxx_works = yes])
|
||||
AC_PROG_YACC
|
||||
@@ -296,4 +297,15 @@ AC_SUBST([GCC])
|
||||
AC_CONFIG_FILES([Makefile
|
||||
po/Makefile.in
|
||||
doc/yacc.1])
|
||||
|
||||
# Fix LIBOBJS to give the Makefile the right file names. Otherwise
|
||||
# compilation works, but with unexpected file names, so clean rules don't
|
||||
# remove the actual files and distcheck fails.
|
||||
AC_CONFIG_COMMANDS_PRE([
|
||||
case $am__api_version in
|
||||
1.14*|1.15*) gl_LIBOBJS=`echo "$gl_LIBOBJS" | sed -e 's, lib/, lib/lib_libbison_a-,g'`;;
|
||||
*) gl_LIBOBJS=`echo "$gl_LIBOBJS" | sed -e 's, lib/, lib/libbison_a-,g'`;;
|
||||
esac
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
@@ -545,7 +545,9 @@ m4_if(b4_skeleton, ["yacc.c"],
|
||||
# endif
|
||||
]])dnl
|
||||
b4_percent_code_get([[pre-printer]])dnl
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
b4_symbol_actions([printer])
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||
b4_percent_code_get([[post-printer]])dnl
|
||||
[}
|
||||
|
||||
|
||||
@@ -1094,17 +1094,20 @@ yyinitStateSet (yyGLRStateSet* yyset)
|
||||
{
|
||||
yyset->yysize = 1;
|
||||
yyset->yycapacity = 16;
|
||||
yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]);
|
||||
yyset->yystates
|
||||
= (yyGLRState**) YYMALLOC (yyset->yycapacity * sizeof yyset->yystates[0]);
|
||||
if (! yyset->yystates)
|
||||
return yyfalse;
|
||||
yyset->yystates[0] = YY_NULLPTR;
|
||||
yyset->yylookaheadNeeds =
|
||||
(yybool*) YYMALLOC (16 * sizeof yyset->yylookaheadNeeds[0]);
|
||||
yyset->yylookaheadNeeds
|
||||
= (yybool*) YYMALLOC (yyset->yycapacity * sizeof yyset->yylookaheadNeeds[0]);
|
||||
if (! yyset->yylookaheadNeeds)
|
||||
{
|
||||
YYFREE (yyset->yystates);
|
||||
return yyfalse;
|
||||
}
|
||||
memset (yyset->yylookaheadNeeds,
|
||||
0, yyset->yycapacity * sizeof yyset->yylookaheadNeeds[0]);
|
||||
return yytrue;
|
||||
}
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ m4_define([b4_shared_declarations],
|
||||
]b4_token_constructor_define[
|
||||
|
||||
private:
|
||||
/// This class is not copiable.
|
||||
/// This class is not copyable.
|
||||
]b4_parser_class[ (const ]b4_parser_class[&);
|
||||
]b4_parser_class[& operator= (const ]b4_parser_class[&);
|
||||
|
||||
@@ -459,9 +459,6 @@ m4_if(b4_prefix, [yy], [],
|
||||
[#define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
|
||||
]b4_yylloc_default_define])[
|
||||
|
||||
// Suppress unused-variable warnings by "using" E.
|
||||
#define YYUSE(E) ((void) (E))
|
||||
|
||||
// Enable debugging if requested.
|
||||
#if ]b4_api_PREFIX[DEBUG
|
||||
|
||||
|
||||
+17
-12
@@ -2,10 +2,8 @@
|
||||
@comment %**start of header
|
||||
@setfilename bison.info
|
||||
@documentencoding UTF-8
|
||||
@documentlanguage en
|
||||
@include version.texi
|
||||
@settitle Bison @value{VERSION}
|
||||
@setchapternewpage odd
|
||||
|
||||
@tex
|
||||
\gdef\rgbWarning{0.50 0 0.50}
|
||||
@@ -58,6 +56,7 @@
|
||||
@c This edition has been formatted so that you can format and print it in
|
||||
@c the smallbook format.
|
||||
@c @smallbook
|
||||
@c @setchapternewpage odd
|
||||
|
||||
@c Set following if you want to document %default-prec and %no-default-prec.
|
||||
@c This feature is experimental and may change in future Bison versions.
|
||||
@@ -11568,7 +11567,7 @@ Instead of using the built-in types you may use the @code{%define} variable
|
||||
The requirements over your @var{LocationType} are:
|
||||
@itemize
|
||||
@item
|
||||
it must be copiable;
|
||||
it must be copyable;
|
||||
|
||||
@item
|
||||
in order to compute the (default) value of @code{@@$} in a reduction, the
|
||||
@@ -11578,7 +11577,7 @@ parser basically runs
|
||||
@@$.end = @@@var{N}.end; // The location of last right-hand side symbol.
|
||||
@end example
|
||||
@noindent
|
||||
so there must be copiable @code{begin} and @code{end} members;
|
||||
so there must be copyable @code{begin} and @code{end} members;
|
||||
|
||||
@item
|
||||
alternatively you may redefine the computation of the default location, in
|
||||
@@ -11733,15 +11732,21 @@ symbol_type (int token, const int&, const location_type&);
|
||||
symbol_type (int token, const location_type&);
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
which should be used in a Flex-scanner as follows.
|
||||
Correct matching between token types and value types is checked via
|
||||
@code{assert}; for instance, @samp{symbol_type (ID, 42)} would abort. Named
|
||||
constructors are preferable (see below), as they offer better type safety
|
||||
(for instance @samp{make_ID (42)} would not even compile), but symbol_type
|
||||
constructors may help when token types are discovered at run-time, e.g.,
|
||||
|
||||
@example
|
||||
%%
|
||||
[a-z]+ return yy::parser::symbol_type (TOK_IDENTIFIER, yytext, loc);
|
||||
[0-9]+ return yy::parser::symbol_type (TOK_INTEGER, text_to_int (yytext), loc);
|
||||
":" return yy::parser::symbol_type (':', loc);
|
||||
<<EOF>> return yy::parser::symbol_type (0, loc);
|
||||
@group
|
||||
[a-z]+ @{
|
||||
if (auto i = lookup_keyword (yytext))
|
||||
return yy::parser::symbol_type (i, loc);
|
||||
else
|
||||
return yy::parser::make_ID (yytext, loc);
|
||||
@}
|
||||
@end group
|
||||
@end example
|
||||
|
||||
@sp 1
|
||||
@@ -14504,7 +14509,7 @@ London, Department of Computer Science, TR-00-12 (December 2000).
|
||||
@c LocalWords: Beazley's goyacc ocamlyacc SIGACT SIGPLAN colorWarning
|
||||
@c LocalWords: setcolor rgbError colorError rgbNotice colorNotice derror
|
||||
@c LocalWords: colorOff maincolor inlineraw darkviolet darkcyan dwarning
|
||||
@c LocalWords: dnotice copiable
|
||||
@c LocalWords: dnotice copyable
|
||||
|
||||
@c Local Variables:
|
||||
@c ispell-dictionary: "american"
|
||||
|
||||
@@ -19,15 +19,17 @@ lexcalcdir = $(docdir)/%D%
|
||||
## Calc. ##
|
||||
## ------ ##
|
||||
|
||||
check_PROGRAMS += %D%/lexcalc
|
||||
TESTS += %D%/lexcalc.test
|
||||
EXTRA_DIST += %D%/lexcalc.test
|
||||
nodist_%C%_lexcalc_SOURCES = %D%/parse.y %D%/parse.h %D%/scan.l
|
||||
if FLEX_WORKS
|
||||
check_PROGRAMS += %D%/lexcalc
|
||||
TESTS += %D%/lexcalc.test
|
||||
nodist_%C%_lexcalc_SOURCES = %D%/parse.y %D%/parse.h %D%/scan.l
|
||||
# Don't use gnulib's system headers.
|
||||
%C%_lexcalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
||||
endif FLEX_WORKS
|
||||
|
||||
%D%/parse.c: $(dependencies)
|
||||
|
||||
# Don't use gnulib's system headers.
|
||||
%C%_lexcalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
||||
|
||||
EXTRA_DIST += %D%/lexcalc.test
|
||||
dist_lexcalc_DATA = %D%/parse.y %D%/scan.l %D%/Makefile %D%/README.md
|
||||
CLEANFILES += %D%/parse.[ch] %D%/scan.c %D%/parse.output
|
||||
CLEANDIRS += %D%/*.dSYM
|
||||
|
||||
@@ -19,11 +19,15 @@ reccalcdir = $(docdir)/%D%
|
||||
## Calc. ##
|
||||
## ------ ##
|
||||
|
||||
check_PROGRAMS += %D%/reccalc
|
||||
TESTS += %D%/reccalc.test
|
||||
EXTRA_DIST += %D%/reccalc.test %D%/scan.l
|
||||
nodist_%C%_reccalc_SOURCES = %D%/parse.y %D%/scan.h %D%/scan.c
|
||||
BUILT_SOURCES += $(nodist_%C%_reccalc_SOURCES)
|
||||
if FLEX_WORKS
|
||||
check_PROGRAMS += %D%/reccalc
|
||||
TESTS += %D%/reccalc.test
|
||||
nodist_%C%_reccalc_SOURCES = %D%/parse.y %D%/scan.h %D%/scan.c
|
||||
BUILT_SOURCES += $(nodist_%C%_reccalc_SOURCES)
|
||||
# Don't use gnulib's system headers.
|
||||
%C%_reccalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
||||
endif FLEX_WORKS
|
||||
|
||||
%D%/parse.c: $(dependencies)
|
||||
|
||||
# Tell Make that parse.o depends on scan.h, so that scan.h is built
|
||||
@@ -44,9 +48,8 @@ DASH = -
|
||||
$(AM_V_at)$(LEX) -o%D%/scan.c --header-file=%D%/scan.h $(srcdir)/%D%/scan.l
|
||||
$(AM_V_at)mv $@.tmp $@
|
||||
|
||||
# Don't use gnulib's system headers.
|
||||
%C%_reccalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
||||
|
||||
EXTRA_DIST += %D%/reccalc.test %D%/scan.l
|
||||
dist_reccalc_DATA = %D%/parse.y %D%/scan.l %D%/Makefile %D%/README.md
|
||||
CLEANFILES += %D%/parse.[ch] %D%/parse.output %D%/scan.[ch] %D%/*.stamp
|
||||
CLEANDIRS += %D%/*.dSYM
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
## which guarantees that parse.y is indeed shipped.
|
||||
|
||||
dist_noinst_SCRIPTS = %D%/extexi %D%/test
|
||||
TEST_LOG_COMPILER = $(top_srcdir)/%D%/test
|
||||
TEST_LOG_COMPILER = $(SHELL) $(top_srcdir)/%D%/test
|
||||
|
||||
AM_CXXFLAGS = \
|
||||
$(WARN_CXXFLAGS) $(WARN_CXXFLAGS_TEST) $(WERROR_CXXFLAGS)
|
||||
|
||||
+1
-1
Submodule gnulib updated: d654989d8b...672663aca3
@@ -1,9 +1,12 @@
|
||||
/*.gmo
|
||||
/*.po
|
||||
/LINGUAS
|
||||
/Makefile
|
||||
/Makefile.in
|
||||
/Makefile.in.in
|
||||
/Makevars
|
||||
/Makevars.template
|
||||
/POTFILES
|
||||
/POTFILES.in
|
||||
/Rules-quot
|
||||
/bison-gnulib.pot
|
||||
|
||||
@@ -321,3 +321,4 @@
|
||||
/assure.h
|
||||
/fsync.c
|
||||
/textstyle.in.h
|
||||
/xhash.c
|
||||
|
||||
@@ -63,6 +63,9 @@ m4_define([_BISON_CXXSTD_11_snippet],
|
||||
for (int r: std::set<int>{1, 2})
|
||||
continue;
|
||||
}
|
||||
|
||||
// GCC 4.8.2 on Solaris 11.3 does not support to_string.
|
||||
auto e = std::to_string(42);
|
||||
])
|
||||
|
||||
m4_define([_BISON_CXXSTD_14_snippet],
|
||||
|
||||
+15
-18
@@ -63,8 +63,6 @@ typedef enum
|
||||
/** For each warning type, its severity. */
|
||||
static severity warnings_flag[warnings_size];
|
||||
|
||||
static unsigned *indent_ptr = NULL;
|
||||
|
||||
styled_ostream_t errstream = NULL;
|
||||
|
||||
void
|
||||
@@ -255,7 +253,7 @@ complain_init_color (void)
|
||||
|| color_mode == color_html
|
||||
|| (color_mode == color_tty && isatty (STDERR_FILENO)))
|
||||
{
|
||||
style_file_prepare ("BISON_STYLE", NULL, pkgdatadir (),
|
||||
style_file_prepare ("BISON_STYLE", "BISON_STYLEDIR", pkgdatadir (),
|
||||
"bison-default.css");
|
||||
/* As a fallback, use the default in the current directory. */
|
||||
struct stat statbuf;
|
||||
@@ -386,6 +384,7 @@ warnings_print_categories (warnings warn_flags, FILE *out)
|
||||
*
|
||||
* \param loc the location, defaulting to the current file,
|
||||
* or the program name.
|
||||
* \param indent optional indentation for the error message.
|
||||
* \param flags the category for this message.
|
||||
* \param sever to decide the prefix to put before the message
|
||||
* (e.g., "warning").
|
||||
@@ -397,8 +396,8 @@ warnings_print_categories (warnings warn_flags, FILE *out)
|
||||
*/
|
||||
static
|
||||
void
|
||||
error_message (const location *loc, warnings flags, severity sever,
|
||||
const char *message, va_list args)
|
||||
error_message (const location *loc, unsigned *indent, warnings flags,
|
||||
severity sever, const char *message, va_list args)
|
||||
{
|
||||
unsigned pos = 0;
|
||||
|
||||
@@ -408,15 +407,14 @@ error_message (const location *loc, warnings flags, severity sever,
|
||||
pos += fprintf (stderr, "%s", current_file ? current_file : program_name);
|
||||
pos += fprintf (stderr, ": ");
|
||||
|
||||
if (indent_ptr)
|
||||
if (indent)
|
||||
{
|
||||
if (*indent_ptr)
|
||||
if (*indent)
|
||||
sever = severity_disabled;
|
||||
if (!*indent_ptr)
|
||||
*indent_ptr = pos;
|
||||
else if (*indent_ptr > pos)
|
||||
fprintf (stderr, "%*s", *indent_ptr - pos, "");
|
||||
indent_ptr = NULL;
|
||||
if (!*indent)
|
||||
*indent = pos;
|
||||
else if (*indent > pos)
|
||||
fprintf (stderr, "%*s", *indent - pos, "");
|
||||
}
|
||||
|
||||
const char* style = severity_style (sever);
|
||||
@@ -451,8 +449,8 @@ error_message (const location *loc, warnings flags, severity sever,
|
||||
/** Raise a complaint (fatal error, error or just warning). */
|
||||
|
||||
static void
|
||||
complains (const location *loc, warnings flags, const char *message,
|
||||
va_list args)
|
||||
complains (const location *loc, unsigned *indent, warnings flags,
|
||||
const char *message, va_list args)
|
||||
{
|
||||
severity s = warning_severity (flags);
|
||||
if ((flags & complaint) && complaint_status < status_complaint)
|
||||
@@ -462,7 +460,7 @@ complains (const location *loc, warnings flags, const char *message,
|
||||
{
|
||||
if (severity_error <= s && ! complaint_status)
|
||||
complaint_status = status_warning_as_error;
|
||||
error_message (loc, flags, s, message, args);
|
||||
error_message (loc, indent, flags, s, message, args);
|
||||
}
|
||||
|
||||
if (flags & fatal)
|
||||
@@ -474,7 +472,7 @@ complain (location const *loc, warnings flags, const char *message, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start (args, message);
|
||||
complains (loc, flags, message, args);
|
||||
complains (loc, NULL, flags, message, args);
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
@@ -483,9 +481,8 @@ complain_indent (location const *loc, warnings flags, unsigned *indent,
|
||||
const char *message, ...)
|
||||
{
|
||||
va_list args;
|
||||
indent_ptr = indent;
|
||||
va_start (args, message);
|
||||
complains (loc, flags, message, args);
|
||||
complains (loc, indent, flags, message, args);
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
|
||||
+42
-25
@@ -229,7 +229,13 @@ location_caret (location loc, const char *style, FILE *out)
|
||||
|
||||
/* Advance to the line's position, keeping track of the offset. */
|
||||
while (caret_info.line < loc.start.line)
|
||||
caret_info.line += getc (caret_info.source) == '\n';
|
||||
{
|
||||
int c = getc (caret_info.source);
|
||||
if (c == EOF)
|
||||
/* Something is wrong, that line number does not exist. */
|
||||
return;
|
||||
caret_info.line += c == '\n';
|
||||
}
|
||||
caret_info.offset = ftell (caret_info.source);
|
||||
|
||||
/* Read the actual line. Don't update the offset, so that we keep a pointer
|
||||
@@ -238,32 +244,43 @@ location_caret (location loc, const char *style, FILE *out)
|
||||
int c = getc (caret_info.source);
|
||||
if (c != EOF)
|
||||
{
|
||||
bool single_line = loc.start.line == loc.end.line;
|
||||
/* Quote the file (at most the first line in the case of
|
||||
multiline locations). */
|
||||
fprintf (out, "%5d | ", loc.start.line);
|
||||
bool single_line = loc.start.line == loc.end.line;
|
||||
/* Consider that single point location (with equal boundaries)
|
||||
actually denote the character that they follow. */
|
||||
int byte_end = loc.end.byte +
|
||||
(single_line && loc.start.byte == loc.end.byte);
|
||||
/* Byte number. */
|
||||
int byte = 1;
|
||||
while (c != EOF && c != '\n')
|
||||
{
|
||||
if (byte == loc.start.byte)
|
||||
begin_use_class (style, out);
|
||||
fputc (c, out);
|
||||
c = getc (caret_info.source);
|
||||
++byte;
|
||||
if (single_line
|
||||
? byte == byte_end
|
||||
: c == '\n' || c == EOF)
|
||||
end_use_class (style, out);
|
||||
}
|
||||
putc ('\n', out);
|
||||
|
||||
{
|
||||
/* Print the carets with the same indentation as above. */
|
||||
fprintf (out, "%5d | ", loc.start.line);
|
||||
/* Consider that single point location (with equal boundaries)
|
||||
actually denote the character that they follow. */
|
||||
int byte_end = loc.end.byte +
|
||||
(single_line && loc.start.byte == loc.end.byte);
|
||||
/* Byte number. */
|
||||
int byte = 1;
|
||||
/* Whether we opened the style. If the line is not as
|
||||
expected (maybe the file was changed since the scanner
|
||||
ran), we might reach the end before we actually saw the
|
||||
opening column. */
|
||||
bool opened = false;
|
||||
while (c != EOF && c != '\n')
|
||||
{
|
||||
if (byte == loc.start.byte)
|
||||
{
|
||||
begin_use_class (style, out);
|
||||
opened = true;
|
||||
}
|
||||
fputc (c, out);
|
||||
c = getc (caret_info.source);
|
||||
++byte;
|
||||
if (opened
|
||||
&& (single_line
|
||||
? byte == byte_end
|
||||
: c == '\n' || c == EOF))
|
||||
end_use_class (style, out);
|
||||
}
|
||||
putc ('\n', out);
|
||||
}
|
||||
|
||||
/* Print the carets with the same indentation as above. */
|
||||
{
|
||||
fprintf (out, " | %*s", loc.start.column - 1, "");
|
||||
begin_use_class (style, out);
|
||||
putc ('^', out);
|
||||
@@ -275,8 +292,8 @@ location_caret (location loc, const char *style, FILE *out)
|
||||
for (int i = loc.start.column + 1; i < len; ++i)
|
||||
putc ('~', out);
|
||||
end_use_class (style, out);
|
||||
putc ('\n', out);
|
||||
}
|
||||
putc ('\n', out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -126,8 +126,8 @@ muscle_init (void)
|
||||
/* Initialize the muscle obstack. */
|
||||
obstack_init (&muscle_obstack);
|
||||
|
||||
muscle_table = hash_initialize (HT_INITIAL_CAPACITY, NULL, hash_muscle,
|
||||
hash_compare_muscles, muscle_entry_free);
|
||||
muscle_table = hash_xinitialize (HT_INITIAL_CAPACITY, NULL, hash_muscle,
|
||||
hash_compare_muscles, muscle_entry_free);
|
||||
|
||||
/* Version and input file. */
|
||||
MUSCLE_INSERT_STRING ("version", VERSION);
|
||||
|
||||
+4
-2
@@ -1,4 +1,4 @@
|
||||
/* A Bison parser, made by GNU Bison 3.4. */
|
||||
/* A Bison parser, made by GNU Bison 3.4.1.26-d17af. */
|
||||
|
||||
/* Bison implementation for Yacc-like parsers in C
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#define YYBISON 1
|
||||
|
||||
/* Bison version. */
|
||||
#define YYBISON_VERSION "3.4"
|
||||
#define YYBISON_VERSION "3.4.1.26-d17af"
|
||||
|
||||
/* Skeleton name. */
|
||||
#define YYSKELETON_NAME "yacc.c"
|
||||
@@ -886,6 +886,7 @@ yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YY
|
||||
/* "%code pre-printer" blocks. */
|
||||
tron (yyo);
|
||||
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
switch (yytype)
|
||||
{
|
||||
case 3: /* "string" */
|
||||
@@ -1069,6 +1070,7 @@ tron (yyo);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||
/* "%code post-printer" blocks. */
|
||||
troff (yyo);
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/* A Bison parser, made by GNU Bison 3.4. */
|
||||
/* A Bison parser, made by GNU Bison 3.4.1.26-d17af. */
|
||||
|
||||
/* Bison interface for Yacc-like parsers in C
|
||||
|
||||
|
||||
+5
-5
@@ -359,11 +359,11 @@ state_hasher (void const *s, size_t tablesize)
|
||||
void
|
||||
state_hash_new (void)
|
||||
{
|
||||
state_table = hash_initialize (HT_INITIAL_CAPACITY,
|
||||
NULL,
|
||||
state_hasher,
|
||||
state_comparator,
|
||||
NULL);
|
||||
state_table = hash_xinitialize (HT_INITIAL_CAPACITY,
|
||||
NULL,
|
||||
state_hasher,
|
||||
state_comparator,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+18
-12
@@ -462,7 +462,13 @@ symbol_class_set (symbol *sym, symbol_class class, location loc, bool declaring)
|
||||
if (declaring)
|
||||
{
|
||||
if (s->status == declared)
|
||||
complain (&loc, Wother, _("symbol %s redeclared"), sym->tag);
|
||||
{
|
||||
unsigned i = 0;
|
||||
complain (&loc, Wother, _("symbol %s redeclared"), sym->tag);
|
||||
i += SUB_INDENT;
|
||||
complain_indent (&sym->location, Wother, &i,
|
||||
_("previous declaration"));
|
||||
}
|
||||
else
|
||||
s->status = declared;
|
||||
}
|
||||
@@ -489,7 +495,7 @@ symbol_user_token_number_set (symbol *sym, int user_token_number, location loc)
|
||||
{
|
||||
*user_token_numberp = user_token_number;
|
||||
/* User defined $end token? */
|
||||
if (user_token_number == 0)
|
||||
if (user_token_number == 0 && !endtoken)
|
||||
{
|
||||
endtoken = sym->content->symbol;
|
||||
/* It is always mapped to 0, so it was already counted in
|
||||
@@ -773,16 +779,16 @@ hash_semantic_type_hasher (void const *m, size_t tablesize)
|
||||
void
|
||||
symbols_new (void)
|
||||
{
|
||||
symbol_table = hash_initialize (HT_INITIAL_CAPACITY,
|
||||
NULL,
|
||||
hash_symbol_hasher,
|
||||
hash_symbol_comparator,
|
||||
symbol_free);
|
||||
semantic_type_table = hash_initialize (HT_INITIAL_CAPACITY,
|
||||
NULL,
|
||||
hash_semantic_type_hasher,
|
||||
hash_semantic_type_comparator,
|
||||
free);
|
||||
symbol_table = hash_xinitialize (HT_INITIAL_CAPACITY,
|
||||
NULL,
|
||||
hash_symbol_hasher,
|
||||
hash_symbol_comparator,
|
||||
symbol_free);
|
||||
semantic_type_table = hash_xinitialize (HT_INITIAL_CAPACITY,
|
||||
NULL,
|
||||
hash_semantic_type_hasher,
|
||||
hash_semantic_type_comparator,
|
||||
free);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+5
-5
@@ -157,11 +157,11 @@ hash_uniqstr (void const *m, size_t tablesize)
|
||||
void
|
||||
uniqstrs_new (void)
|
||||
{
|
||||
uniqstrs_table = hash_initialize (HT_INITIAL_CAPACITY,
|
||||
NULL,
|
||||
hash_uniqstr,
|
||||
hash_compare_uniqstr,
|
||||
free);
|
||||
uniqstrs_table = hash_xinitialize (HT_INITIAL_CAPACITY,
|
||||
NULL,
|
||||
hash_uniqstr,
|
||||
hash_compare_uniqstr,
|
||||
free);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -313,7 +313,7 @@ AT_DATA_GRAMMAR([list.y],
|
||||
}
|
||||
|
||||
#if defined __cplusplus && 201103L <= __cplusplus
|
||||
string (string&& s)
|
||||
string (string&& s) noexcept
|
||||
: val_(std::move(s.val_))
|
||||
{
|
||||
s.val_.clear();
|
||||
|
||||
+73
-4
@@ -35,17 +35,23 @@ AT_BISON_OPTION_PUSHDEFS
|
||||
|
||||
AT_DATA_GRAMMAR([[input.y]], [$2])
|
||||
|
||||
AT_DATA([experr.orig], [$4])
|
||||
# For some reason, literal ^M in the input are removed and don't end
|
||||
# in `input.y`. So use the two-character ^M represent it, and let
|
||||
# Perl insert real CR characters.
|
||||
AT_CHECK([perl -pi -e 's{\^M}{\r}gx' input.y])
|
||||
|
||||
AT_DATA([experr], [$4])
|
||||
|
||||
AT_CHECK([LC_ALL=en_US.UTF-8 bison -fcaret --color=debug -Wall input.y], [$3], [], [experr])
|
||||
|
||||
# When no style, same messages, but without style.
|
||||
AT_CHECK([perl -p -e 's{</?\w+>}{}g' <experr.orig >experr])
|
||||
AT_CHECK([perl -pi -e 's{(</?\w+>)}{ $[]1 eq "<tag>" ? $[]1 : "" }ge' experr])
|
||||
|
||||
# Cannot use AT_BISON_CHECK easily as we need to change the
|
||||
# environment.
|
||||
# FIXME: Enhance AT_BISON_CHECK.
|
||||
AT_CHECK([LC_ALL=en_US.UTF-8 bison -fcaret -Wall input.y], [$3], [], [experr])
|
||||
|
||||
AT_CHECK([cp experr.orig experr])
|
||||
AT_CHECK([LC_ALL=en_US.UTF-8 bison -fcaret --color=debug -Wall input.y], [$3], [], [experr])
|
||||
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
|
||||
@@ -67,18 +73,33 @@ exp: %empty;
|
||||
[[input.y:9.12-14: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
|
||||
9 | %token FOO <warning>FOO</warning> FOO
|
||||
| <warning>^~~</warning>
|
||||
input.y:9.8-10: previous declaration
|
||||
9 | %token <note>FOO</note> FOO FOO
|
||||
| <note>^~~</note>
|
||||
input.y:9.16-18: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
|
||||
9 | %token FOO FOO <warning>FOO</warning>
|
||||
| <warning>^~~</warning>
|
||||
input.y:9.8-10: previous declaration
|
||||
9 | %token <note>FOO</note> FOO FOO
|
||||
| <note>^~~</note>
|
||||
input.y:10.8-10: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
|
||||
10 | %token <warning>FOO</warning> FOO FOO
|
||||
| <warning>^~~</warning>
|
||||
input.y:9.8-10: previous declaration
|
||||
9 | %token <note>FOO</note> FOO FOO
|
||||
| <note>^~~</note>
|
||||
input.y:10.13-15: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
|
||||
10 | %token FOO <warning>FOO</warning> FOO
|
||||
| <warning>^~~</warning>
|
||||
input.y:9.8-10: previous declaration
|
||||
9 | %token <note>FOO</note> FOO FOO
|
||||
| <note>^~~</note>
|
||||
input.y:10.18-20: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
|
||||
10 | %token FOO FOO <warning>FOO</warning>
|
||||
| <warning>^~~</warning>
|
||||
input.y:9.8-10: previous declaration
|
||||
9 | %token <note>FOO</note> FOO FOO
|
||||
| <note>^~~</note>
|
||||
]])
|
||||
|
||||
|
||||
@@ -240,5 +261,53 @@ input.y: <warning>warning:</warning> fix-its can be applied. Rerun with option
|
||||
]])
|
||||
|
||||
|
||||
## ----------------- ##
|
||||
## Carriage return. ##
|
||||
## ----------------- ##
|
||||
|
||||
# Carriage-return used to count as a newline in the scanner, and not
|
||||
# in diagnostics. Resulting in all sort of nice bugs.
|
||||
|
||||
AT_TEST([[Carriage return]],
|
||||
[[^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M
|
||||
%token "
|
||||
%%
|
||||
]],
|
||||
[1],
|
||||
[[input.y:37.8-38.0: <error>error:</error> missing '"' at end of line
|
||||
input.y:37.8-38.0: <error>error:</error> syntax error, unexpected string, expecting char or identifier or <tag>
|
||||
]])
|
||||
|
||||
|
||||
|
||||
m4_popdef([AT_TEST])
|
||||
|
||||
|
||||
|
||||
|
||||
## -------------------------------------- ##
|
||||
## Indentation with message suppression. ##
|
||||
## -------------------------------------- ##
|
||||
|
||||
AT_SETUP([[Indentation with message suppression]])
|
||||
|
||||
# https://lists.gnu.org/archive/html/bug-bison/2019-08/msg00002.html
|
||||
|
||||
AT_DATA([[input.y]],
|
||||
[[%define api.pure
|
||||
%pure-parser
|
||||
%error-verbose
|
||||
%%
|
||||
exp : '0'
|
||||
]])
|
||||
|
||||
AT_BISON_CHECK([[-fcaret -Wno-other input.y]], [0], [],
|
||||
[[input.y:2.1-12: warning: deprecated directive, use '%define api.pure' [-Wdeprecated]
|
||||
2 | %pure-parser
|
||||
| ^~~~~~~~~~~~
|
||||
input.y:3.1-14: warning: deprecated directive, use '%define parse.error verbose' [-Wdeprecated]
|
||||
3 | %error-verbose
|
||||
| ^~~~~~~~~~~~~~
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
@@ -615,6 +615,44 @@ AT_CHECK_UNUSED_VALUES([1], [1])
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
## ------------------- ##
|
||||
## Symbol redeclared. ##
|
||||
## ------------------- ##
|
||||
|
||||
AT_SETUP([Symbol redeclared])
|
||||
|
||||
AT_DATA([[input.y]],
|
||||
[[%token FOO FOO
|
||||
%token BAR 12 BAR 12
|
||||
%token EOF 0 EOF 0
|
||||
%%
|
||||
exp: FOO BAR
|
||||
]])
|
||||
|
||||
AT_BISON_CHECK([-fcaret input.y], [0], [],
|
||||
[[input.y:1.12-14: warning: symbol FOO redeclared [-Wother]
|
||||
1 | %token FOO FOO
|
||||
| ^~~
|
||||
input.y:1.8-10: previous declaration
|
||||
1 | %token FOO FOO
|
||||
| ^~~
|
||||
input.y:2.15-17: warning: symbol BAR redeclared [-Wother]
|
||||
2 | %token BAR 12 BAR 12
|
||||
| ^~~
|
||||
input.y:2.8-10: previous declaration
|
||||
2 | %token BAR 12 BAR 12
|
||||
| ^~~
|
||||
input.y:3.14-16: warning: symbol EOF redeclared [-Wother]
|
||||
3 | %token EOF 0 EOF 0
|
||||
| ^~~
|
||||
input.y:3.8-10: previous declaration
|
||||
3 | %token EOF 0 EOF 0
|
||||
| ^~~
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
## --------------------------- ##
|
||||
## Symbol class redefinition. ##
|
||||
## --------------------------- ##
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ $(TESTSUITE): $(TESTSUITE_AT)
|
||||
## -------------------- ##
|
||||
|
||||
# Move into %D%/ so that testsuite.dir etc. be created there.
|
||||
RUN_TESTSUITE = $(TESTSUITE) -C %D% $(TESTSUITEFLAGS)
|
||||
RUN_TESTSUITE = $(SHELL) $(TESTSUITE) -C %D% $(TESTSUITEFLAGS)
|
||||
check_SCRIPTS += $(BISON) %D%/atconfig %D%/atlocal
|
||||
RUN_TESTSUITE_deps = all $(TESTSUITE) $(check_SCRIPTS)
|
||||
|
||||
|
||||
+4
-5
@@ -397,19 +397,18 @@ AT_BISON_OPTION_POPDEFS
|
||||
# unnecessarily escaped here even though it would need to be if encoded in a
|
||||
# C-string literal. Also notice that unnecessary escaping, such as "\?", from
|
||||
# the user specification is eliminated.
|
||||
AT_BISON_CHECK([-o input.c input.y], [[0]], [[]],
|
||||
[[input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother]
|
||||
input.y:22.16-63: warning: symbol "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used more than once as a literal string [-Wother]
|
||||
]])
|
||||
|
||||
AT_BISON_CHECK([-fcaret -o input.c input.y], [[0]], [[]],
|
||||
[[input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother]
|
||||
22 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
||||
| ^~~~~~~
|
||||
input.y:21.8-14: previous declaration
|
||||
21 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
||||
| ^~~~~~~
|
||||
input.y:22.16-63: warning: symbol "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used more than once as a literal string [-Wother]
|
||||
22 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
||||
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
]])
|
||||
|
||||
AT_COMPILE([input])
|
||||
|
||||
# Checking the error message here guarantees that yytname, which does contain
|
||||
|
||||
Reference in New Issue
Block a user