mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-12 20:25:13 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5fb8b11152 | ||
|
|
2a1aefbf76 | ||
|
|
734b0ce45d | ||
|
|
59bcaebfae | ||
|
|
680b715518 | ||
|
|
2eb1ad9ef3 | ||
|
|
0360a35228 | ||
|
|
2e053317c8 | ||
|
|
33c788d37b | ||
|
|
c03d0d9625 | ||
|
|
bf7abf4849 | ||
|
|
2731332150 | ||
|
|
554a12102e | ||
|
|
b590ad0292 | ||
|
|
05e70adf22 | ||
|
|
7efe0b5da3 | ||
|
|
351e3630bb | ||
|
|
4fd1fc70e0 | ||
|
|
e02ce4c7f0 | ||
|
|
7cab285eda | ||
|
|
86efe28222 | ||
|
|
cf1446dc9e | ||
|
|
e93c40b33d | ||
|
|
eff6739124 | ||
|
|
5a0d7802f4 | ||
|
|
f1e0839c9e | ||
|
|
3bf429aed8 | ||
|
|
f8cadc731b | ||
|
|
bd7aebb8b0 | ||
|
|
ca8039e612 | ||
|
|
5d07f4f726 | ||
|
|
e605ad9679 | ||
|
|
50fac71d46 |
+1
-1
@@ -1 +1 @@
|
|||||||
3.1.91
|
3.2.1
|
||||||
|
|||||||
+64
-40
@@ -12,9 +12,70 @@ env:
|
|||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
## ------- ##
|
||||||
|
## First. ##
|
||||||
|
## ------- ##
|
||||||
|
|
||||||
|
# Start with three completely different environments, to get
|
||||||
|
# errors asap.
|
||||||
|
|
||||||
|
- name: "GCC 7 -O3"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- g++-7
|
||||||
|
env:
|
||||||
|
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && 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 on go. Run in two parts.
|
||||||
|
- name: "Clang 7 libc++ and ASAN part 1"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- llvm-toolchain-trusty-7
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- clang-7
|
||||||
|
- libc++-7-dev
|
||||||
|
- libc++abi-7-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++'"
|
||||||
|
|
||||||
|
- name: "Clang 7 libc++ and ASAN part 2"
|
||||||
|
os: linux
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- llvm-toolchain-trusty-7
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
packages:
|
||||||
|
- clang-7
|
||||||
|
- libc++-7-dev
|
||||||
|
- libc++abi-7-dev
|
||||||
|
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++'"
|
||||||
|
|
||||||
|
- name: "ICC"
|
||||||
|
os: linux
|
||||||
|
env:
|
||||||
|
# ICC's warnings are often very wrong (e.g., it thinks foo ?
|
||||||
|
# "bar" : "baz" is char* instead of const char*), so don't try
|
||||||
|
# to work around the, and obviously, don't die on them.
|
||||||
|
- MATRIX_EVAL="CC=icc && CXX=icpc"
|
||||||
|
- MAKE_ARGS='WERROR_CFLAGS= WERROR_CXXFLAGS='
|
||||||
|
|
||||||
|
|
||||||
## ----- ##
|
## ----- ##
|
||||||
## GCC. ##
|
## GCC. ##
|
||||||
## ----- ##
|
## ----- ##
|
||||||
|
|
||||||
#- name: "GCC 8 with sanitizers"
|
#- name: "GCC 8 with sanitizers"
|
||||||
# os: linux
|
# os: linux
|
||||||
# addons:
|
# addons:
|
||||||
@@ -29,17 +90,6 @@ matrix:
|
|||||||
# # /usr/bin/ld: unrecognized option '--push-state'
|
# # /usr/bin/ld: unrecognized option '--push-state'
|
||||||
# - MATRIX_EVAL="CC='gcc-8 -fsanitize=undefined,address -fno-omit-frame-pointer' CXX='g++-8 -fsanitize=undefined,address -fno-omit-frame-pointer'"
|
# - 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 -O3"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- g++-7
|
|
||||||
env:
|
|
||||||
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'"
|
|
||||||
|
|
||||||
- name: "GCC 6"
|
- name: "GCC 6"
|
||||||
os: linux
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
@@ -110,21 +160,6 @@ matrix:
|
|||||||
## Clang. ##
|
## Clang. ##
|
||||||
## ------- ##
|
## ------- ##
|
||||||
|
|
||||||
- name: "Clang 7 libc++ and ASAN"
|
|
||||||
os: linux
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- llvm-toolchain-trusty-7
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- clang-7
|
|
||||||
- libc++-7-dev
|
|
||||||
- libc++abi-7-dev
|
|
||||||
env:
|
|
||||||
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
|
||||||
- MATRIX_EVAL="CC='clang-7 -fsanitize=address' CXX='clang++-7 -fsanitize=address -stdlib=libc++'"
|
|
||||||
|
|
||||||
- name: "Clang 6 -O3 and libc++"
|
- name: "Clang 6 -O3 and libc++"
|
||||||
os: linux
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
@@ -242,17 +277,6 @@ matrix:
|
|||||||
# See comment for 3.4.
|
# See comment for 3.4.
|
||||||
- MATRIX_EVAL='CC=/usr/bin/clang && CXX=/usr/bin/clang++'
|
- MATRIX_EVAL='CC=/usr/bin/clang && CXX=/usr/bin/clang++'
|
||||||
|
|
||||||
## ----- ##
|
|
||||||
## ICC. ##
|
|
||||||
## ----- ##
|
|
||||||
- name: "ICC"
|
|
||||||
os: linux
|
|
||||||
env:
|
|
||||||
# ICC's warnings are often very wrong (e.g., it thinks foo ?
|
|
||||||
# "bar" : "baz" is char* instead of const char*), so don't try
|
|
||||||
# to work around the, and obviously, don't die on them.
|
|
||||||
- MATRIX_EVAL="CC=icc && CXX=icpc"
|
|
||||||
- MAKE_ARGS='WERROR_CFLAGS= WERROR_CXXFLAGS='
|
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- eval "$MATRIX_EVAL"
|
- eval "$MATRIX_EVAL"
|
||||||
@@ -285,9 +309,9 @@ script:
|
|||||||
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
|
- if [[ -f ~/.bashrc ]]; then source ~/.bashrc; fi
|
||||||
- ./configure --enable-gcc-warnings CC="$CC" CXX="$CXX" $CONFIGUREFLAGS || { cat config.log && false; }
|
- ./configure --enable-gcc-warnings CC="$CC" CXX="$CXX" $CONFIGUREFLAGS || { cat config.log && false; }
|
||||||
- make -j2 $MAKE_ARGS
|
- make -j2 $MAKE_ARGS
|
||||||
- make check VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }
|
- if test ${PART-1} = 1; then make check VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
|
||||||
- make maintainer-check-posix VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }
|
- if test ${PART-1} = 1; then make maintainer-check-posix VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
|
||||||
- make maintainer-check-g++ VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }
|
- if test ${PART-2} = 2; then make maintainer-check-g++ VERBOSE=1 TESTSUITEFLAGS=-j2 || { cat tests/testsuite.log && false; }; fi
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
- if [[ $CC == "icc" ]]; then uninstall_intel_software; fi
|
- if [[ $CC == "icc" ]]; then uninstall_intel_software; fi
|
||||||
|
|||||||
@@ -1,5 +1,18 @@
|
|||||||
GNU Bison NEWS
|
GNU Bison NEWS
|
||||||
|
|
||||||
|
* Noteworthy changes in release 3.2.2 (2018-11-21) [stable]
|
||||||
|
|
||||||
|
** Bug fixes
|
||||||
|
|
||||||
|
C++ portability issues.
|
||||||
|
|
||||||
|
* Noteworthy changes in release 3.2.1 (2018-11-09) [stable]
|
||||||
|
|
||||||
|
** Bug fixes
|
||||||
|
|
||||||
|
Several portability issues have been fixed in the build system, in the
|
||||||
|
test suite, and in the generated parsers in C++.
|
||||||
|
|
||||||
* Noteworthy changes in release 3.2 (2018-10-29) [stable]
|
* Noteworthy changes in release 3.2 (2018-10-29) [stable]
|
||||||
|
|
||||||
** Backward incompatible changes
|
** Backward incompatible changes
|
||||||
|
|||||||
@@ -3,11 +3,13 @@ it is today without the invaluable help of these people:
|
|||||||
|
|
||||||
Aaro Koskinen [email protected]
|
Aaro Koskinen [email protected]
|
||||||
Аскар Сафин [email protected]
|
Аскар Сафин [email protected]
|
||||||
|
Adam Sampson [email protected]
|
||||||
Airy Andre [email protected]
|
Airy Andre [email protected]
|
||||||
Akim Demaille [email protected]
|
Akim Demaille [email protected]
|
||||||
Albert Chin-A-Young [email protected]
|
Albert Chin-A-Young [email protected]
|
||||||
Alexander Belopolsky [email protected]
|
Alexander Belopolsky [email protected]
|
||||||
Alexandre Duret-Lutz [email protected]
|
Alexandre Duret-Lutz [email protected]
|
||||||
|
Andre da Costa Barros [email protected]
|
||||||
Andreas Schwab [email protected]
|
Andreas Schwab [email protected]
|
||||||
Andrew Suffield [email protected]
|
Andrew Suffield [email protected]
|
||||||
Angelo Borsotti [email protected]
|
Angelo Borsotti [email protected]
|
||||||
@@ -68,6 +70,7 @@ Goran Uddeborg [email protected]
|
|||||||
Guido Trentalancia [email protected]
|
Guido Trentalancia [email protected]
|
||||||
H. Merijn Brand [email protected]
|
H. Merijn Brand [email protected]
|
||||||
Hans Åberg [email protected]
|
Hans Åberg [email protected]
|
||||||
|
Horst Von Brand [email protected]
|
||||||
Jan Nieuwenhuizen [email protected]
|
Jan Nieuwenhuizen [email protected]
|
||||||
Jannick [email protected]
|
Jannick [email protected]
|
||||||
Jerry Quinn [email protected]
|
Jerry Quinn [email protected]
|
||||||
@@ -84,6 +87,7 @@ Juan Manuel Guerrero [email protected]
|
|||||||
Kees Zeelenberg [email protected]
|
Kees Zeelenberg [email protected]
|
||||||
Keith Browne [email protected]
|
Keith Browne [email protected]
|
||||||
Ken Moffat [email protected]
|
Ken Moffat [email protected]
|
||||||
|
Kiyoshi Kanazawa [email protected]
|
||||||
Laurent Mascherpa [email protected]
|
Laurent Mascherpa [email protected]
|
||||||
Lie Yan [email protected]
|
Lie Yan [email protected]
|
||||||
Magnus Fromreide [email protected]
|
Magnus Fromreide [email protected]
|
||||||
@@ -104,6 +108,7 @@ Michel d'Hooge [email protected]
|
|||||||
Michiel De Wilde [email protected]
|
Michiel De Wilde [email protected]
|
||||||
Mickael Labau [email protected]
|
Mickael Labau [email protected]
|
||||||
Mike Castle [email protected]
|
Mike Castle [email protected]
|
||||||
|
Mike Frysinger [email protected]
|
||||||
Mike Sullivan [email protected]
|
Mike Sullivan [email protected]
|
||||||
Nate Guerin [email protected]
|
Nate Guerin [email protected]
|
||||||
Neil Booth [email protected]
|
Neil Booth [email protected]
|
||||||
@@ -146,6 +151,7 @@ Roland Levillain [email protected]
|
|||||||
Satya Kiran Popuri [email protected]
|
Satya Kiran Popuri [email protected]
|
||||||
Sebastian Setzer [email protected]
|
Sebastian Setzer [email protected]
|
||||||
Sebastien Fricker [email protected]
|
Sebastien Fricker [email protected]
|
||||||
|
Sébastien Villemot [email protected]
|
||||||
Sergei Steshenko [email protected]
|
Sergei Steshenko [email protected]
|
||||||
Shura [email protected]
|
Shura [email protected]
|
||||||
Simon Sobisch [email protected]
|
Simon Sobisch [email protected]
|
||||||
|
|||||||
@@ -220,6 +220,10 @@ The users are not provided with enough tools to forge their error messages.
|
|||||||
See for instance "Is there an option to change the message produced by
|
See for instance "Is there an option to change the message produced by
|
||||||
YYERROR_VERBOSE?" by Simon Sobisch, on bison-help.
|
YYERROR_VERBOSE?" by Simon Sobisch, on bison-help.
|
||||||
|
|
||||||
|
See also
|
||||||
|
https://www.cs.tufts.edu/~nr/cs257/archive/clinton-jefferey/lr-error-messages.pdf
|
||||||
|
and https://research.swtch.com/yyerror.
|
||||||
|
|
||||||
** %include
|
** %include
|
||||||
This is a popular demand. We already made many changes in the parser that
|
This is a popular demand. We already made many changes in the parser that
|
||||||
should make this reasonably easy to implement.
|
should make this reasonably easy to implement.
|
||||||
|
|||||||
+9
-3
@@ -53,8 +53,14 @@ m4_define([b4_inline],
|
|||||||
# b4_cxx_portability
|
# b4_cxx_portability
|
||||||
# ------------------
|
# ------------------
|
||||||
m4_define([b4_cxx_portability],
|
m4_define([b4_cxx_portability],
|
||||||
[// Support move semantics when possible.
|
[#if defined __cplusplus
|
||||||
#if defined __cplusplus && 201103L <= __cplusplus
|
# define YY_CPLUSPLUS __cplusplus
|
||||||
|
#else
|
||||||
|
# define YY_CPLUSPLUS 199711L
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Support move semantics when possible.
|
||||||
|
#if 201103L <= YY_CPLUSPLUS
|
||||||
# define YY_MOVE std::move
|
# define YY_MOVE std::move
|
||||||
# define YY_MOVE_OR_COPY move
|
# define YY_MOVE_OR_COPY move
|
||||||
# define YY_MOVE_REF(Type) Type&&
|
# define YY_MOVE_REF(Type) Type&&
|
||||||
@@ -272,7 +278,7 @@ m4_define([b4_symbol_type_declare],
|
|||||||
location_type location;])[
|
location_type location;])[
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#if defined __cplusplus && __cplusplus < 201103L
|
#if YY_CPLUSPLUS < 201103L
|
||||||
/// Assignment operator.
|
/// Assignment operator.
|
||||||
basic_symbol& operator= (const basic_symbol& other);
|
basic_symbol& operator= (const basic_symbol& other);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -227,12 +227,19 @@ m4_define([b4_attribute_define],
|
|||||||
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
|
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
]m4_bmatch([$1], [\bnoreturn\b], [[#if !defined _Noreturn \
|
]m4_bmatch([$1], [\bnoreturn\b], [[/* The _Noreturn keyword of C11. */
|
||||||
&& (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
|
#if ! defined _Noreturn
|
||||||
# if defined _MSC_VER && 1200 <= _MSC_VER
|
# if defined __cplusplus && 201103L <= __cplusplus
|
||||||
# define _Noreturn __declspec (noreturn)
|
# define _Noreturn [[noreturn]]
|
||||||
# else
|
# elif !(defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)
|
||||||
# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
|
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
|
||||||
|
|| 0x5110 <= __SUNPRO_C)
|
||||||
|
# define _Noreturn __attribute__ ((__noreturn__))
|
||||||
|
# elif defined _MSC_VER && 1200 <= _MSC_VER
|
||||||
|
# define _Noreturn __declspec (noreturn)
|
||||||
|
# else
|
||||||
|
# define _Noreturn
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -706,7 +706,7 @@ struct yyGLRStack {
|
|||||||
static void yyexpandGLRStack (yyGLRStack* yystackp);
|
static void yyexpandGLRStack (yyGLRStack* yystackp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static _Noreturn void
|
_Noreturn static void
|
||||||
yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg)
|
yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg)
|
||||||
{
|
{
|
||||||
if (yymsg != YY_NULLPTR)
|
if (yymsg != YY_NULLPTR)
|
||||||
@@ -714,7 +714,7 @@ yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg)
|
|||||||
YYLONGJMP (yystackp->yyexception_buffer, 1);
|
YYLONGJMP (yystackp->yyexception_buffer, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static _Noreturn void
|
_Noreturn static void
|
||||||
yyMemoryExhausted (yyGLRStack* yystackp)
|
yyMemoryExhausted (yyGLRStack* yystackp)
|
||||||
{
|
{
|
||||||
YYLONGJMP (yystackp->yyexception_buffer, 2);
|
YYLONGJMP (yystackp->yyexception_buffer, 2);
|
||||||
|
|||||||
+6
-5
@@ -272,8 +272,9 @@ m4_define([b4_shared_declarations],
|
|||||||
/// Print the state stack on the debug stream.
|
/// Print the state stack on the debug stream.
|
||||||
virtual void yystack_print_ ();
|
virtual void yystack_print_ ();
|
||||||
|
|
||||||
// Debugging.
|
/// Debugging level.
|
||||||
int yydebug_;
|
int yydebug_;
|
||||||
|
/// Debug stream.
|
||||||
std::ostream* yycdebug_;
|
std::ostream* yycdebug_;
|
||||||
|
|
||||||
/// \brief Display a symbol type, value and location.
|
/// \brief Display a symbol type, value and location.
|
||||||
@@ -335,7 +336,7 @@ m4_define([b4_shared_declarations],
|
|||||||
stack_symbol_type (YY_RVREF (stack_symbol_type) that);
|
stack_symbol_type (YY_RVREF (stack_symbol_type) that);
|
||||||
/// Steal the contents from \a sym to build this.
|
/// Steal the contents from \a sym to build this.
|
||||||
stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
|
stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
|
||||||
#if defined __cplusplus && __cplusplus < 201103L
|
#if YY_CPLUSPLUS < 201103L
|
||||||
/// Assignment, needed by push_back by some old implementations.
|
/// Assignment, needed by push_back by some old implementations.
|
||||||
/// Moves the contents of that.
|
/// Moves the contents of that.
|
||||||
stack_symbol_type& operator= (stack_symbol_type& that);
|
stack_symbol_type& operator= (stack_symbol_type& that);
|
||||||
@@ -611,7 +612,7 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
{]b4_variant_if([
|
{]b4_variant_if([
|
||||||
b4_symbol_variant([that.type_get ()],
|
b4_symbol_variant([that.type_get ()],
|
||||||
[value], [YY_MOVE_OR_COPY], [YY_MOVE (that.value)])])[
|
[value], [YY_MOVE_OR_COPY], [YY_MOVE (that.value)])])[
|
||||||
#if defined __cplusplus && 201103L <= __cplusplus
|
#if 201103L <= YY_CPLUSPLUS
|
||||||
// that is emptied.
|
// that is emptied.
|
||||||
that.state = empty_state;
|
that.state = empty_state;
|
||||||
#endif
|
#endif
|
||||||
@@ -626,7 +627,7 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
that.type = empty_symbol;
|
that.type = empty_symbol;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined __cplusplus && __cplusplus < 201103L
|
#if YY_CPLUSPLUS < 201103L
|
||||||
]b4_parser_class_name[::stack_symbol_type&
|
]b4_parser_class_name[::stack_symbol_type&
|
||||||
]b4_parser_class_name[::stack_symbol_type::operator= (stack_symbol_type& that)
|
]b4_parser_class_name[::stack_symbol_type::operator= (stack_symbol_type& that)
|
||||||
{
|
{
|
||||||
@@ -684,7 +685,7 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
void
|
void
|
||||||
]b4_parser_class_name[::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
|
]b4_parser_class_name[::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
|
||||||
{
|
{
|
||||||
#if defined __cplusplus && 201103L <= __cplusplus
|
#if 201103L <= YY_CPLUSPLUS
|
||||||
yypush_ (m, stack_symbol_type (s, std::move (sym)));
|
yypush_ (m, stack_symbol_type (s, std::move (sym)));
|
||||||
#else
|
#else
|
||||||
stack_symbol_type ss (s, sym);
|
stack_symbol_type ss (s, sym);
|
||||||
|
|||||||
+2
-2
@@ -59,7 +59,7 @@ m4_ifdef([b4_location_file],
|
|||||||
# ------------------
|
# ------------------
|
||||||
# Define the position and location classes.
|
# Define the position and location classes.
|
||||||
m4_define([b4_location_define],
|
m4_define([b4_location_define],
|
||||||
[[ /// Abstract a position.
|
[[ /// A point in a source file.
|
||||||
class position
|
class position
|
||||||
{
|
{
|
||||||
public:]m4_ifdef([b4_location_constructors], [[
|
public:]m4_ifdef([b4_location_constructors], [[
|
||||||
@@ -178,7 +178,7 @@ m4_define([b4_location_define],
|
|||||||
return ostr << pos.line << '.' << pos.column;
|
return ostr << pos.line << '.' << pos.column;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Abstract a location.
|
/// Two points in a source file.
|
||||||
class location
|
class location
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
+30
-12
@@ -125,7 +125,7 @@ m4_define([b4_variant_define],
|
|||||||
return *new (yyas_<T> ()) T ();
|
return *new (yyas_<T> ()) T ();
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined __cplusplus && 201103L <= __cplusplus
|
# if 201103L <= YY_CPLUSPLUS
|
||||||
/// Instantiate a \a T in here from \a t.
|
/// Instantiate a \a T in here from \a t.
|
||||||
template <typename T, typename U>
|
template <typename T, typename U>
|
||||||
T&
|
T&
|
||||||
@@ -213,7 +213,7 @@ m4_define([b4_variant_define],
|
|||||||
void
|
void
|
||||||
move (self_type& other)
|
move (self_type& other)
|
||||||
{
|
{
|
||||||
# if defined __cplusplus && 201103L <= __cplusplus
|
# if 201103L <= YY_CPLUSPLUS
|
||||||
emplace<T> (std::move (other.as<T> ()));
|
emplace<T> (std::move (other.as<T> ()));
|
||||||
# else
|
# else
|
||||||
emplace<T> ();
|
emplace<T> ();
|
||||||
@@ -222,7 +222,7 @@ m4_define([b4_variant_define],
|
|||||||
other.destroy<T> ();
|
other.destroy<T> ();
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined __cplusplus && 201103L <= __cplusplus
|
# if 201103L <= YY_CPLUSPLUS
|
||||||
/// Move the content of \a other to this.
|
/// Move the content of \a other to this.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void
|
void
|
||||||
@@ -379,26 +379,44 @@ b4_join(b4_symbol_if([$1], [has_type],
|
|||||||
# -----------------------------------
|
# -----------------------------------
|
||||||
# Generate a constructor declaration for basic_symbol from given type.
|
# Generate a constructor declaration for basic_symbol from given type.
|
||||||
m4_define([b4_basic_symbol_constructor_declare],
|
m4_define([b4_basic_symbol_constructor_declare],
|
||||||
[[ basic_symbol (]b4_join(
|
[[# if 201103L <= YY_CPLUSPLUS
|
||||||
|
basic_symbol (]b4_join(
|
||||||
[typename Base::kind_type t],
|
[typename Base::kind_type t],
|
||||||
b4_symbol_if([$1], [has_type], [YY_RVREF (b4_symbol([$1], [type])) v]),
|
b4_symbol_if([$1], [has_type], [b4_symbol([$1], [type])&& v]),
|
||||||
b4_locations_if([YY_RVREF (location_type) l]))[);
|
b4_locations_if([location_type&& l]))[);
|
||||||
|
#else
|
||||||
|
basic_symbol (]b4_join(
|
||||||
|
[typename Base::kind_type t],
|
||||||
|
b4_symbol_if([$1], [has_type], [const b4_symbol([$1], [type])& v]),
|
||||||
|
b4_locations_if([const location_type& l]))[);
|
||||||
|
#endif
|
||||||
]])
|
]])
|
||||||
|
|
||||||
# b4_basic_symbol_constructor_define
|
# b4_basic_symbol_constructor_define
|
||||||
# ----------------------------------
|
# ----------------------------------
|
||||||
# Generate a constructor implementation for basic_symbol from given type.
|
# Generate a constructor implementation for basic_symbol from given type.
|
||||||
m4_define([b4_basic_symbol_constructor_define],
|
m4_define([b4_basic_symbol_constructor_define],
|
||||||
[[ template <typename Base>
|
[[# if 201103L <= YY_CPLUSPLUS
|
||||||
|
template <typename Base>
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
|
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
|
||||||
[typename Base::kind_type t],
|
[typename Base::kind_type t],
|
||||||
b4_symbol_if([$1], [has_type], [YY_RVREF (b4_symbol([$1], [type])) v]),
|
b4_symbol_if([$1], [has_type], [b4_symbol([$1], [type])&& v]),
|
||||||
b4_locations_if([YY_RVREF (location_type) l]))[)
|
b4_locations_if([location_type&& l]))[)
|
||||||
: Base (t)]b4_symbol_if([$1], [has_type], [
|
: Base (t)]b4_symbol_if([$1], [has_type], [
|
||||||
, value (YY_MOVE (v))])[]b4_locations_if([
|
, value (std::move (v))])[]b4_locations_if([
|
||||||
, location (YY_MOVE (l))])[
|
, location (std::move (l))])[
|
||||||
{}
|
{}
|
||||||
|
#else
|
||||||
|
template <typename Base>
|
||||||
|
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
|
||||||
|
[typename Base::kind_type t],
|
||||||
|
b4_symbol_if([$1], [has_type], [const b4_symbol([$1], [type])& v]),
|
||||||
|
b4_locations_if([const location_type& l]))[)
|
||||||
|
: Base (t)]b4_symbol_if([$1], [has_type], [
|
||||||
|
, value (v)])[]b4_locations_if([
|
||||||
|
, location (l)])[
|
||||||
|
{}
|
||||||
|
#endif
|
||||||
]])
|
]])
|
||||||
|
|
||||||
# b4_symbol_constructor_define
|
# b4_symbol_constructor_define
|
||||||
|
|||||||
+2
-1
@@ -11810,6 +11810,7 @@ then the parser's to get the set of defined tokens.
|
|||||||
# include <cerrno>
|
# include <cerrno>
|
||||||
# include <climits>
|
# include <climits>
|
||||||
# include <cstdlib>
|
# include <cstdlib>
|
||||||
|
# include <cstring> // strerror
|
||||||
# include <string>
|
# include <string>
|
||||||
# include "driver.hh"
|
# include "driver.hh"
|
||||||
# include "parser.hh"
|
# include "parser.hh"
|
||||||
@@ -11835,7 +11836,7 @@ then the parser's to get the set of defined tokens.
|
|||||||
// Of course, when compiling C as C++, expect warnings about NULL.
|
// Of course, when compiling C as C++, expect warnings about NULL.
|
||||||
#if defined __clang__
|
#if defined __clang__
|
||||||
# pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
|
# pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
|
||||||
#elif defined __GNUC__
|
#elif defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
|
||||||
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
|
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -32,7 +32,7 @@ $(doc_bison).html: $(FIGS_GV:.gv=.png)
|
|||||||
TEXI2DVI = texi2dvi --build-dir=doc/bison.t2d -I doc
|
TEXI2DVI = texi2dvi --build-dir=doc/bison.t2d -I doc
|
||||||
CLEANDIRS += doc/bison.t2d
|
CLEANDIRS += doc/bison.t2d
|
||||||
|
|
||||||
MOSTLYCLEANFILES += $(top_srcdir)/doc/*.t
|
MOSTLYCLEANFILES += $(top_srcdir)/doc/*.tmp
|
||||||
|
|
||||||
CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl
|
CROSS_OPTIONS_PL = $(top_srcdir)/build-aux/cross-options.pl
|
||||||
CROSS_OPTIONS_TEXI = $(top_srcdir)/doc/cross-options.texi
|
CROSS_OPTIONS_TEXI = $(top_srcdir)/doc/cross-options.texi
|
||||||
@@ -64,7 +64,7 @@ doc/refcard.pdf: doc/refcard.tex
|
|||||||
## doc/bison.help. ##
|
## doc/bison.help. ##
|
||||||
## ---------------- ##
|
## ---------------- ##
|
||||||
|
|
||||||
# Some of our targets (cross-option.texi, bison.1) use "bison --help".
|
# Some of our targets (cross-options.texi, bison.1) use "bison --help".
|
||||||
# Since we want to ship the generated file to avoid additional
|
# Since we want to ship the generated file to avoid additional
|
||||||
# requirements over the user environment, we used to not depend on
|
# requirements over the user environment, we used to not depend on
|
||||||
# src/bison itself, but on src/getargs.c and other files. Yet, we
|
# src/bison itself, but on src/getargs.c and other files. Yet, we
|
||||||
@@ -80,7 +80,7 @@ doc/refcard.pdf: doc/refcard.tex
|
|||||||
# bison.help, which contains --version then --help. This file can
|
# bison.help, which contains --version then --help. This file can
|
||||||
# depend on bison, which ensures its correctness. But update it
|
# depend on bison, which ensures its correctness. But update it
|
||||||
# *only* if needed (content changes). This way, we avoid useless
|
# *only* if needed (content changes). This way, we avoid useless
|
||||||
# compilations of cross-option.texi and bison.1. At the cost of
|
# compilations of cross-options.texi and bison.1. At the cost of
|
||||||
# repeated builds of bison.help.
|
# repeated builds of bison.help.
|
||||||
|
|
||||||
EXTRA_DIST += $(top_srcdir)/doc/bison.help
|
EXTRA_DIST += $(top_srcdir)/doc/bison.help
|
||||||
@@ -117,14 +117,14 @@ endif
|
|||||||
$(top_srcdir)/doc/bison.1: $(MAN_DEPS)
|
$(top_srcdir)/doc/bison.1: $(MAN_DEPS)
|
||||||
$(AM_V_GEN)$(HELP2MAN) \
|
$(AM_V_GEN)$(HELP2MAN) \
|
||||||
--include=$(top_srcdir)/doc/bison.x \
|
--include=$(top_srcdir)/doc/bison.x \
|
||||||
--output=$@.t src/bison$(EXEEXT)
|
--output=$@.tmp src/bison$(EXEEXT)
|
||||||
$(AM_V_at)if $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \
|
$(AM_V_at)if $(remove_time_stamp) $@ >$@a.tmp 2>/dev/null && \
|
||||||
$(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \
|
$(remove_time_stamp) $@.tmp | cmp $@a.tmp - >/dev/null 2>&1; then \
|
||||||
touch $@; \
|
touch $@; \
|
||||||
else \
|
else \
|
||||||
mv $@.t $@; \
|
mv $@.tmp $@; \
|
||||||
fi
|
fi
|
||||||
$(AM_V_at)rm -f $@*.t
|
$(AM_V_at)rm -f $@*.tmp
|
||||||
|
|
||||||
if ENABLE_YACC
|
if ENABLE_YACC
|
||||||
nodist_man_MANS = doc/yacc.1
|
nodist_man_MANS = doc/yacc.1
|
||||||
|
|||||||
+15
-10
@@ -32,34 +32,39 @@ if ENABLE_CXX14
|
|||||||
check_PROGRAMS += %D%/simple
|
check_PROGRAMS += %D%/simple
|
||||||
nodist_%C%_simple_SOURCES = $(simple_sources)
|
nodist_%C%_simple_SOURCES = $(simple_sources)
|
||||||
|
|
||||||
%C%_simple_CXXFLAGS = $(CXX11_CXXFLAGS)
|
%C%_simple_CXXFLAGS = $(CXX11_CXXFLAGS) $(WARN_CXXFLAGS_TEST)
|
||||||
# Don't use gnulib's system headers.
|
# Don't use gnulib's system headers.
|
||||||
%C%_simple_CPPFLAGS = -I$(top_builddir)
|
%C%_simple_CPPFLAGS = -I$(top_builddir)
|
||||||
dist_TESTS += %D%/simple.test
|
TESTS += %D%/simple.test
|
||||||
%D%/simple.cc: $(BISON_IN) $(dist_pkgdata_DATA)
|
%D%/simple.cc: $(BISON_IN) $(dist_pkgdata_DATA)
|
||||||
endif
|
endif
|
||||||
|
EXTRA_DIST += %D%/simple.test
|
||||||
|
|
||||||
|
|
||||||
## ---------- ##
|
## ---------- ##
|
||||||
## Variants. ##
|
## Variants. ##
|
||||||
## ---------- ##
|
## ---------- ##
|
||||||
|
|
||||||
check_PROGRAMS += %D%/variant
|
if ENABLE_CXX
|
||||||
nodist_%C%_variant_SOURCES = %D%/variant.yy
|
check_PROGRAMS += %D%/variant
|
||||||
# Don't use gnulib's system headers.
|
nodist_%C%_variant_SOURCES = %D%/variant.yy
|
||||||
%C%_variant_CPPFLAGS = -I$(top_builddir)
|
# Don't use gnulib's system headers.
|
||||||
dist_TESTS += %D%/variant.test
|
%C%_variant_CPPFLAGS = -I$(top_builddir)
|
||||||
%D%/variant.cc: $(BISON_IN) $(dist_pkgdata_DATA)
|
TESTS += %D%/variant.test
|
||||||
|
%D%/variant.cc: $(BISON_IN) $(dist_pkgdata_DATA)
|
||||||
|
endif
|
||||||
|
EXTRA_DIST += %D%/variant.test
|
||||||
|
|
||||||
if ENABLE_CXX11
|
if ENABLE_CXX11
|
||||||
check_PROGRAMS += %D%/variant-11
|
check_PROGRAMS += %D%/variant-11
|
||||||
nodist_%C%_variant_11_SOURCES = %D%/variant-11.yy
|
nodist_%C%_variant_11_SOURCES = %D%/variant-11.yy
|
||||||
%C%_variant_11_CXXFLAGS = $(CXX11_CXXFLAGS)
|
%C%_variant_11_CXXFLAGS = $(CXX11_CXXFLAGS) $(WARN_CXXFLAGS_TEST)
|
||||||
# Don't use gnulib's system headers.
|
# Don't use gnulib's system headers.
|
||||||
%C%_variant_11_CPPFLAGS = -I$(top_builddir)
|
%C%_variant_11_CPPFLAGS = -I$(top_builddir)
|
||||||
dist_TESTS += %D%/variant-11.test
|
TESTS += %D%/variant-11.test
|
||||||
%D%/variant-11.cc: $(BISON_IN) $(dist_pkgdata_DATA)
|
%D%/variant-11.cc: $(BISON_IN) $(dist_pkgdata_DATA)
|
||||||
endif
|
endif
|
||||||
|
EXTRA_DIST += %D%/variant-11.test
|
||||||
|
|
||||||
dist_cxx_DATA = %D%/README %D%/Makefile %D%/variant.yy %D%/variant-11.yy
|
dist_cxx_DATA = %D%/README %D%/Makefile %D%/variant.yy %D%/variant-11.yy
|
||||||
CLEANFILES += %D%/simple.output %D%/variant.output %D%/variant-11.output
|
CLEANFILES += %D%/simple.output %D%/variant.output %D%/variant-11.output
|
||||||
|
|||||||
@@ -37,9 +37,8 @@
|
|||||||
|
|
||||||
%code // *.cc
|
%code // *.cc
|
||||||
{
|
{
|
||||||
#include <algorithm>
|
#include <climits> // INT_MIN, INT_MAX
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iterator>
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
namespace yy
|
namespace yy
|
||||||
@@ -141,7 +140,10 @@ int
|
|||||||
main (int argc, const char *argv[])
|
main (int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
if (2 <= argc && isdigit (*argv[1]))
|
if (2 <= argc && isdigit (*argv[1]))
|
||||||
max = strtol (argv[1], nullptr, 10);
|
{
|
||||||
|
auto maxl = strtol (argv[1], nullptr, 10);
|
||||||
|
max = INT_MIN <= maxl && maxl <= INT_MAX ? int(maxl) : 4;
|
||||||
|
}
|
||||||
auto&& p = yy::parser{};
|
auto&& p = yy::parser{};
|
||||||
p.set_debug_level (!!getenv ("YYDEBUG"));
|
p.set_debug_level (!!getenv ("YYDEBUG"));
|
||||||
return p.parse ();
|
return p.parse ();
|
||||||
|
|||||||
@@ -33,9 +33,7 @@ typedef std::vector<std::string> strings_type;
|
|||||||
|
|
||||||
%code // *.cc
|
%code // *.cc
|
||||||
{
|
{
|
||||||
#include <algorithm>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iterator>
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
namespace yy
|
namespace yy
|
||||||
@@ -98,7 +96,7 @@ item:
|
|||||||
namespace yy
|
namespace yy
|
||||||
{
|
{
|
||||||
// Use nullptr with pre-C++11.
|
// Use nullptr with pre-C++11.
|
||||||
#if defined __cplusplus && __cplusplus < 201103L
|
#if !defined __cplusplus || __cplusplus < 201103L
|
||||||
# define NULLPTR 0
|
# define NULLPTR 0
|
||||||
#else
|
#else
|
||||||
# define NULLPTR nullptr
|
# define NULLPTR nullptr
|
||||||
|
|||||||
+10
-13
@@ -57,25 +57,22 @@ extracted += $(calcxx_extracted)
|
|||||||
calcxx_sources_generated = \
|
calcxx_sources_generated = \
|
||||||
%D%/parser.cc \
|
%D%/parser.cc \
|
||||||
%D%/parser.hh \
|
%D%/parser.hh \
|
||||||
%D%/location.hh \
|
%D%/location.hh
|
||||||
%D%/position.hh \
|
|
||||||
%D%/stack.hh
|
|
||||||
calcxx_sources = \
|
calcxx_sources = \
|
||||||
$(calcxx_sources_extracted) \
|
$(calcxx_sources_extracted) \
|
||||||
$(calcxx_sources_generated)
|
$(calcxx_sources_generated)
|
||||||
|
|
||||||
if FLEX_CXX_WORKS
|
if FLEX_CXX_WORKS
|
||||||
check_PROGRAMS += %D%/calc++
|
if ENABLE_CXX
|
||||||
nodist_%C%_calc___SOURCES = \
|
check_PROGRAMS += %D%/calc++
|
||||||
$(calcxx_sources)
|
nodist_%C%_calc___SOURCES = $(calcxx_sources)
|
||||||
|
# Don't use gnulib's system headers.
|
||||||
# Don't use gnulib's system headers.
|
%C%_calc___CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
||||||
%C%_calc___CPPFLAGS = -I$(top_builddir)/%D%
|
%C%_calc___CXXFLAGS = $(AM_CXXFLAGS) $(FLEX_SCANNER_CXXFLAGS)
|
||||||
%C%_calc___CXXFLAGS = $(AM_CXXFLAGS) $(FLEX_SCANNER_CXXFLAGS)
|
TESTS += %D%/calc++.test
|
||||||
dist_TESTS += %D%/calc++.test
|
endif ENABLE_CXX
|
||||||
else
|
endif FLEX_CXX_WORKS
|
||||||
EXTRA_DIST += %D%/calc++.test
|
EXTRA_DIST += %D%/calc++.test
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
## ------------ ##
|
## ------------ ##
|
||||||
|
|||||||
+25
-2
@@ -30,7 +30,8 @@ EXTEXIFLAGS = --synclines
|
|||||||
endif
|
endif
|
||||||
extract = VERSION="$(VERSION)" $(PERL) $(extexi) $(EXTEXIFLAGS) $(doc) --
|
extract = VERSION="$(VERSION)" $(PERL) $(extexi) $(EXTEXIFLAGS) $(doc) --
|
||||||
extracted =
|
extracted =
|
||||||
CLEANFILES += $(extracted) %D%/extracted.stamp
|
EXTRA_DIST += $(extracted)
|
||||||
|
MAINTAINERCLEANFILES += $(extracted) %D%/extracted.stamp
|
||||||
%D%/extracted.stamp: $(doc) $(extexi)
|
%D%/extracted.stamp: $(doc) $(extexi)
|
||||||
$(AM_V_GEN)rm -f $@ $@.tmp
|
$(AM_V_GEN)rm -f $@ $@.tmp
|
||||||
$(AM_V_at)$(MKDIR_P) %D%
|
$(AM_V_at)$(MKDIR_P) %D%
|
||||||
@@ -42,11 +43,33 @@ $(extracted): %D%/extracted.stamp
|
|||||||
@test -f $@ || rm -f %D%/extracted.stamp
|
@test -f $@ || rm -f %D%/extracted.stamp
|
||||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) %D%/extracted.stamp
|
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) %D%/extracted.stamp
|
||||||
|
|
||||||
|
|
||||||
|
## ------ ##
|
||||||
|
## Dist. ##
|
||||||
|
## ------ ##
|
||||||
|
|
||||||
|
# Ship the stamp file, otherwise it will be recreated, which is what
|
||||||
|
# we want to avoid.
|
||||||
|
EXTRA_DIST += %D%/extracted.stamp
|
||||||
|
|
||||||
|
# Suppress the #lines from the examples when rolling the tarball, so
|
||||||
|
# that regular users have readable examples even before installing
|
||||||
|
# Bison.
|
||||||
|
dist-hook: examples-unline
|
||||||
|
.PHONY: examples-unline
|
||||||
|
examples-unline:
|
||||||
|
for e in $(extracted); \
|
||||||
|
do \
|
||||||
|
e=$(distdir)/$$e; \
|
||||||
|
sed -e '/#line/d' $$e >$$e.tmp; \
|
||||||
|
mv -f $$e.tmp $$e; \
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
## ---------- ##
|
## ---------- ##
|
||||||
## Examples. ##
|
## Examples. ##
|
||||||
## ---------- ##
|
## ---------- ##
|
||||||
|
|
||||||
|
|
||||||
examplesdir = $(docdir)/examples
|
examplesdir = $(docdir)/examples
|
||||||
dist_examples_DATA = %D%/README
|
dist_examples_DATA = %D%/README
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ extracted += $(mfcalc_extracted)
|
|||||||
check_PROGRAMS += %D%/mfcalc
|
check_PROGRAMS += %D%/mfcalc
|
||||||
nodist_%C%_mfcalc_SOURCES = $(mfcalc_sources)
|
nodist_%C%_mfcalc_SOURCES = $(mfcalc_sources)
|
||||||
# Don't use gnulib's system headers.
|
# Don't use gnulib's system headers.
|
||||||
%C%_mfcalc_CPPFLAGS = -I$(top_builddir)/%D%
|
%C%_mfcalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
|
||||||
%C%_mfcalc_LDADD = -lm
|
%C%_mfcalc_LDADD = -lm
|
||||||
|
|
||||||
dist_TESTS += %D%/mfcalc.test
|
dist_TESTS += %D%/mfcalc.test
|
||||||
|
|||||||
+6
-6
@@ -45,7 +45,7 @@ fi
|
|||||||
# -------
|
# -------
|
||||||
cleanup ()
|
cleanup ()
|
||||||
{
|
{
|
||||||
local status=$?
|
status=$?
|
||||||
if test -z "$DEBUG"; then
|
if test -z "$DEBUG"; then
|
||||||
cd $cwd
|
cd $cwd
|
||||||
rm -rf $$.dir
|
rm -rf $$.dir
|
||||||
@@ -61,22 +61,22 @@ cd $$.dir
|
|||||||
# -noerr: ignore stderr, otherwise merge it into effective output.
|
# -noerr: ignore stderr, otherwise merge it into effective output.
|
||||||
run ()
|
run ()
|
||||||
{
|
{
|
||||||
local noerr=false
|
noerr=false
|
||||||
case $1 in
|
case $1 in
|
||||||
(-noerr) noerr=true; shift;;
|
(-noerr) noerr=true; shift;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Expected exit status.
|
# Expected exit status.
|
||||||
local sta_exp="$1"
|
sta_exp=$1
|
||||||
shift
|
shift
|
||||||
# Expected output.
|
# Expected output.
|
||||||
local out_exp="$1"
|
out_exp=$1
|
||||||
shift
|
shift
|
||||||
# Effective exit status.
|
# Effective exit status.
|
||||||
local sta_eff=0
|
sta_eff=0
|
||||||
$prog "$@" - <input >out_eff 2>err_eff || sta_eff=$?
|
$prog "$@" - <input >out_eff 2>err_eff || sta_eff=$?
|
||||||
# Combine effective output and error streams.
|
# Combine effective output and error streams.
|
||||||
local out_eff="$(cat out_eff && $noerr || sed -e 's/^/err: /g' err_eff)"
|
out_eff=$(cat out_eff && $noerr || sed -e 's/^/err: /g' err_eff)
|
||||||
if test $sta_eff -eq $sta_exp; then
|
if test $sta_eff -eq $sta_exp; then
|
||||||
if test "$out_eff" = "$out_exp"; then
|
if test "$out_eff" = "$out_exp"; then
|
||||||
echo "$me: PASS: $number"
|
echo "$me: PASS: $number"
|
||||||
|
|||||||
+1
-1
Submodule gnulib updated: a79f2a2871...48a6c46b0b
+1
-1
@@ -353,7 +353,7 @@ bitset_count_ (bitset src)
|
|||||||
{
|
{
|
||||||
bitset_bindex next = 0;
|
bitset_bindex next = 0;
|
||||||
bitset_bindex num;
|
bitset_bindex num;
|
||||||
while (num = bitset_list (src, list, BITSET_LIST_SIZE, &next))
|
while ((num = bitset_list (src, list, BITSET_LIST_SIZE, &next)))
|
||||||
count += num;
|
count += num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,15 +45,6 @@ lib_libbison_a_SOURCES += \
|
|||||||
lib/path-join.h \
|
lib/path-join.h \
|
||||||
lib/path-join.c
|
lib/path-join.c
|
||||||
|
|
||||||
lib_libbison_a_LIBADD += \
|
|
||||||
$(ISNAND_LIBM) \
|
|
||||||
$(ISNANF_LIBM) \
|
|
||||||
$(ISNANL_LIBM) \
|
|
||||||
$(LDEXPL_LIBM) \
|
|
||||||
$(LDEXP_LIBM) \
|
|
||||||
$(LIB_CLOCK_GETTIME) \
|
|
||||||
$(LIB_GETHRXTIME)
|
|
||||||
|
|
||||||
# The Yacc compatibility library.
|
# The Yacc compatibility library.
|
||||||
if ENABLE_YACC
|
if ENABLE_YACC
|
||||||
lib_LIBRARIES = lib/liby.a
|
lib_LIBRARIES = lib/liby.a
|
||||||
|
|||||||
@@ -190,3 +190,4 @@
|
|||||||
/localtime-buffer.m4
|
/localtime-buffer.m4
|
||||||
/sys_resource_h.m4
|
/sys_resource_h.m4
|
||||||
/timespec.m4
|
/timespec.m4
|
||||||
|
/intl-thread-locale.m4
|
||||||
|
|||||||
@@ -50,14 +50,12 @@ AC_DEFUN([BISON_TEST_FOR_WORKING_CXX_COMPILER],
|
|||||||
AC_LANG_POP([C++])])
|
AC_LANG_POP([C++])])
|
||||||
|
|
||||||
case $bison_cv_cxx_works in
|
case $bison_cv_cxx_works in
|
||||||
yes)
|
yes) BISON_CXX_WORKS=':';;
|
||||||
BISON_CXX_WORKS=':';;
|
no | cross) BISON_CXX_WORKS='false';;
|
||||||
no | cross)
|
|
||||||
BISON_CXX_WORKS='exit 77';;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
AC_SUBST([BISON_CXX_WORKS])
|
AC_SUBST([BISON_CXX_WORKS])
|
||||||
AM_CONDITIONAL(BISON_CXX_WORKS, test $bison_cv_cxx_works = yes)
|
AM_CONDITIONAL([ENABLE_CXX], [test $bison_cv_cxx_works = yes])
|
||||||
])
|
])
|
||||||
|
|
||||||
# BISON_CXX_COMPILER_POSIXLY_CORRECT
|
# BISON_CXX_COMPILER_POSIXLY_CORRECT
|
||||||
|
|||||||
@@ -104,9 +104,19 @@ BUILT_SOURCES += \
|
|||||||
src/scan-gram.c \
|
src/scan-gram.c \
|
||||||
src/scan-skel.c
|
src/scan-skel.c
|
||||||
|
|
||||||
|
# Although conceptually most of these guys would make more sense in the
|
||||||
|
# definition of libbison, beware that they might expand as flags such as
|
||||||
|
# `-lm`. Keep them here. Or use a Libtool convenience library.
|
||||||
src_bison_LDADD = \
|
src_bison_LDADD = \
|
||||||
|
$(ISNAND_LIBM) \
|
||||||
|
$(ISNANF_LIBM) \
|
||||||
|
$(ISNANL_LIBM) \
|
||||||
|
$(LDEXPL_LIBM) \
|
||||||
|
$(LDEXP_LIBM) \
|
||||||
$(LIBINTL) \
|
$(LIBINTL) \
|
||||||
$(LIBTHREAD) \
|
$(LIBTHREAD) \
|
||||||
|
$(LIB_CLOCK_GETTIME) \
|
||||||
|
$(LIB_GETHRXTIME) \
|
||||||
lib/libbison.a
|
lib/libbison.a
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-4
@@ -98,10 +98,8 @@ fi
|
|||||||
: ${CXX_COMPILER_POSIXLY_CORRECT='@CXX_COMPILER_POSIXLY_CORRECT@'}
|
: ${CXX_COMPILER_POSIXLY_CORRECT='@CXX_COMPILER_POSIXLY_CORRECT@'}
|
||||||
|
|
||||||
if $POSIXLY_CORRECT_IS_EXPORTED; then
|
if $POSIXLY_CORRECT_IS_EXPORTED; then
|
||||||
$C_COMPILER_POSIXLY_CORRECT ||
|
$C_COMPILER_POSIXLY_CORRECT || BISON_C_WORKS=false
|
||||||
BISON_C_WORKS="as_fn_error 77 POSIXLY_CORRECT"
|
$CXX_COMPILER_POSIXLY_CORRECT || BISON_CXX_WORKS=false
|
||||||
$CXX_COMPILER_POSIXLY_CORRECT ||
|
|
||||||
BISON_CXX_WORKS="as_fn_error 77 POSIXLY_CORRECT"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Handle --compile-c-with-cxx here, once CXX and CXXFLAGS are known.
|
# Handle --compile-c-with-cxx here, once CXX and CXXFLAGS are known.
|
||||||
|
|||||||
+4
-3
@@ -679,14 +679,15 @@ m4_define([AT_CHECK_DOXYGEN],
|
|||||||
[m4_fatal([invalid argument: $1])])
|
[m4_fatal([invalid argument: $1])])
|
||||||
AT_SETUP([Doxygen $1 Documentation])
|
AT_SETUP([Doxygen $1 Documentation])
|
||||||
|
|
||||||
AT_BISON_OPTION_PUSHDEFS([%skeleton "lalr1.cc"])
|
AT_BISON_OPTION_PUSHDEFS([%skeleton "lalr1.cc" %locations])
|
||||||
AT_DATA([input.yy],
|
AT_DATA([input.yy],
|
||||||
[[%skeleton "lalr1.cc"
|
[[%require "3.2"
|
||||||
|
%skeleton "lalr1.cc"
|
||||||
%locations
|
%locations
|
||||||
%defines
|
%defines
|
||||||
%debug
|
%debug
|
||||||
%%
|
%%
|
||||||
exp: /* empty */;
|
exp: %empty;
|
||||||
%%
|
%%
|
||||||
]AT_YYERROR_DEFINE[
|
]AT_YYERROR_DEFINE[
|
||||||
]])
|
]])
|
||||||
|
|||||||
+3
-2
@@ -41,7 +41,7 @@ AT_DATA_GRAMMAR([$1.y],
|
|||||||
]AT_YYLEX_DECLARE_EXTERN[
|
]AT_YYLEX_DECLARE_EXTERN[
|
||||||
%}
|
%}
|
||||||
%%
|
%%
|
||||||
dummy: /* empty */;
|
dummy: %empty;
|
||||||
%%
|
%%
|
||||||
#include <$1.h>
|
#include <$1.h>
|
||||||
])
|
])
|
||||||
@@ -81,7 +81,7 @@ AT_DATA_GRAMMAR([input.y],
|
|||||||
]AT_YYLEX_DEFINE[
|
]AT_YYLEX_DEFINE[
|
||||||
%}
|
%}
|
||||||
%%
|
%%
|
||||||
exp: /* empty */;
|
exp: %empty;
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AT_BISON_CHECK([--defines -o input.c input.y])
|
AT_BISON_CHECK([--defines -o input.c input.y])
|
||||||
@@ -317,6 +317,7 @@ AT_CHECK([[$PERL -n -0777 -e '
|
|||||||
|YYUSE
|
|YYUSE
|
||||||
|YY_ATTRIBUTE(?:_PURE|_UNUSED)?
|
|YY_ATTRIBUTE(?:_PURE|_UNUSED)?
|
||||||
|YY_COPY
|
|YY_COPY
|
||||||
|
|YY_CPLUSPLUS
|
||||||
|YY_IGNORE_MAYBE_UNINITIALIZED_(?:BEGIN|END)
|
|YY_IGNORE_MAYBE_UNINITIALIZED_(?:BEGIN|END)
|
||||||
|YY_INITIAL_VALUE
|
|YY_INITIAL_VALUE
|
||||||
|YY_MOVE
|
|YY_MOVE
|
||||||
|
|||||||
+7
-1
@@ -36,7 +36,13 @@ AT_BISON_CHECK([1.y 2.y], [1], [],
|
|||||||
Try 'bison --help' for more information.
|
Try 'bison --help' for more information.
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AT_BISON_CHECK([--skeleton], [1], [],
|
# For some reason, on some systems we use the system's getopt, not the
|
||||||
|
# one we ship in gnulib. So we can get two different error messages.
|
||||||
|
# See https://lists.gnu.org/archive/html/bison-patches/2018-10/msg00154.html
|
||||||
|
AT_BISON_CHECK([--skeleton], [1], [], [stderr])
|
||||||
|
AT_CHECK([[sed -e \
|
||||||
|
"s/requires an argument -- skeleton/'--skeleton' requires an argument/" \
|
||||||
|
stderr]], 0,
|
||||||
[[bison: option '--skeleton' requires an argument
|
[[bison: option '--skeleton' requires an argument
|
||||||
Try 'bison --help' for more information.
|
Try 'bison --help' for more information.
|
||||||
]])
|
]])
|
||||||
|
|||||||
+47
-30
@@ -539,6 +539,9 @@ main (int argc, char const* argv[])
|
|||||||
return ]AT_NAME_PREFIX[parse ();
|
return ]AT_NAME_PREFIX[parse ();
|
||||||
}]])
|
}]])
|
||||||
|
|
||||||
|
m4_define([AT_LANG_FOR_EACH_STD(c)],
|
||||||
|
[$1])
|
||||||
|
|
||||||
|
|
||||||
## ----- ##
|
## ----- ##
|
||||||
## C++. ##
|
## C++. ##
|
||||||
@@ -573,21 +576,24 @@ main (int argc, char const* argv[])
|
|||||||
return p.parse ();
|
return p.parse ();
|
||||||
}]])
|
}]])
|
||||||
|
|
||||||
|
m4_define([AT_LANG_FOR_EACH_STD(c++)],
|
||||||
|
[AT_FOR_EACH_CXX([$1])])
|
||||||
|
|
||||||
m4_define([AT_FOR_EACH_CXX],
|
m4_define([AT_FOR_EACH_CXX],
|
||||||
[[at_for_each_cxx_CXXFLAGS_save=$CXXFLAGS
|
[[at_for_each_std_CXXFLAGS_save=$CXXFLAGS
|
||||||
for at_cxx_std in '' \
|
for at_std in '' \
|
||||||
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
|
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
|
||||||
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
|
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
|
||||||
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
|
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
|
||||||
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
|
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
|
||||||
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
|
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
|
||||||
${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"}
|
${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"}
|
||||||
do
|
do
|
||||||
]AS_ECHO(["======== Testing with C++ standard flags: '$at_cxx_std'"])[
|
]AS_ECHO(["======== Testing with C++ standard flags: '$at_cxx_std'"])[
|
||||||
CXXFLAGS="$at_for_each_cxx_CXXFLAGS_save $at_cxx_std"
|
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
|
||||||
]$1[
|
]$1[
|
||||||
done
|
done
|
||||||
CXXFLAGS=$at_for_each_cxx_CXXFLAGS_save
|
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
|
||||||
]])
|
]])
|
||||||
|
|
||||||
## ------ ##
|
## ------ ##
|
||||||
@@ -619,7 +625,8 @@ m4_define([AT_MAIN_DEFINE(java)],
|
|||||||
}
|
}
|
||||||
}]])
|
}]])
|
||||||
|
|
||||||
|
m4_define([AT_LANG_FOR_EACH_STD(java)],
|
||||||
|
[$1])
|
||||||
|
|
||||||
## --------------- ##
|
## --------------- ##
|
||||||
## Running Bison. ##
|
## Running Bison. ##
|
||||||
@@ -777,7 +784,7 @@ m4_define([AT_QUELL_VALGRIND],
|
|||||||
# otherwise pass "-c"; this is a hack. The default SOURCES is OUTPUT
|
# otherwise pass "-c"; this is a hack. The default SOURCES is OUTPUT
|
||||||
# with trailing .o removed, and ".c" appended.
|
# with trailing .o removed, and ".c" appended.
|
||||||
m4_define([AT_COMPILE],
|
m4_define([AT_COMPILE],
|
||||||
[AT_CHECK([$BISON_C_WORKS], 0, ignore, ignore)
|
[AT_SKIP_IF([[! $BISON_C_WORKS]])
|
||||||
AT_CHECK(m4_join([ ],
|
AT_CHECK(m4_join([ ],
|
||||||
[$CC $CFLAGS $CPPFLAGS $3],
|
[$CC $CFLAGS $CPPFLAGS $3],
|
||||||
[m4_bmatch([$1], [[.]], [-c], [$LDFLAGS])],
|
[m4_bmatch([$1], [[.]], [-c], [$LDFLAGS])],
|
||||||
@@ -797,7 +804,7 @@ AT_CHECK(m4_join([ ],
|
|||||||
# with trailing ".o" removed, and ".cc" appended.
|
# with trailing ".o" removed, and ".cc" appended.
|
||||||
m4_define([AT_COMPILE_CXX],
|
m4_define([AT_COMPILE_CXX],
|
||||||
[AT_KEYWORDS(c++)
|
[AT_KEYWORDS(c++)
|
||||||
AT_CHECK([$BISON_CXX_WORKS], 0, ignore, ignore)
|
AT_SKIP_IF([[! $BISON_CXX_WORKS]])
|
||||||
AT_CHECK(m4_join([ ],
|
AT_CHECK(m4_join([ ],
|
||||||
[$CXX $CXXFLAGS $CPPFLAGS $3],
|
[$CXX $CXXFLAGS $CPPFLAGS $3],
|
||||||
[m4_bmatch([$1], [[.]], [-c], [$LDFLAGS])],
|
[m4_bmatch([$1], [[.]], [-c], [$LDFLAGS])],
|
||||||
@@ -819,6 +826,11 @@ AT_CHECK([[$SHELL ../../../javacomp.sh ]$1],
|
|||||||
[[0]], [ignore], [ignore])])
|
[[0]], [ignore], [ignore])])
|
||||||
|
|
||||||
|
|
||||||
|
# AT_LANG_FOR_EACH_STD(BODY)
|
||||||
|
# -------------------------------
|
||||||
|
m4_define([AT_LANG_FOR_EACH_STD], [AT_LANG_DISPATCH([$0], $@)])
|
||||||
|
|
||||||
|
|
||||||
# AT_LANG_COMPILE(OUTPUT, [SOURCES = OUTPUT.c], [EXTRA-COMPILER-FLAGS])
|
# AT_LANG_COMPILE(OUTPUT, [SOURCES = OUTPUT.c], [EXTRA-COMPILER-FLAGS])
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
# Compile SOURCES into OUTPUT. Skip if compiler does not work.
|
# Compile SOURCES into OUTPUT. Skip if compiler does not work.
|
||||||
@@ -904,30 +916,35 @@ AT_PARSER_CHECK([./c-and-cxx])
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
# AT_REQUIRE_CXX_VERSION(STD)
|
# AT_REQUIRE_CXX_STD(STD, [IF-FAIL = SKIP])
|
||||||
# ---------------------------
|
# -----------------------------------------
|
||||||
# Skip unless this compiler supports at least C++ STD (e.g., "11",
|
# Skip unless this compiler supports at least C++ STD (e.g., "11",
|
||||||
# "14", etc.).
|
# "14", etc.).
|
||||||
m4_define([AT_REQUIRE_CXX_VERSION],
|
m4_define([AT_REQUIRE_CXX_STD],
|
||||||
[AT_DATA([check.cc],
|
[AT_DATA([check.cc],
|
||||||
[[int main ()
|
[[int main ()
|
||||||
{
|
{
|
||||||
#if __cplusplus < ]m4_case([$1],
|
#if !defined __cplusplus || __cplusplus < ]m4_case([$1],
|
||||||
[98], [199711],
|
[98], [199711],
|
||||||
[03], [199711],
|
[03], [199711],
|
||||||
[11], [201103],
|
[11], [201103],
|
||||||
[14], [201402],
|
[14], [201402],
|
||||||
[17], [201703],
|
[17], [201703],
|
||||||
[2a], [201709],
|
[2a], [201709],
|
||||||
[m4_fatal([$0: invalid arguments: $@])])[
|
[m4_fatal([$0: invalid arguments: $@])])[
|
||||||
return 77;
|
return 1;
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
]])
|
]])
|
||||||
AT_COMPILE_CXX([check])
|
AT_COMPILE_CXX([check])
|
||||||
AT_CHECK([@&t@./check])
|
AT_CHECK([@&t@./check], [ignore])
|
||||||
|
m4_ifval([$2],
|
||||||
|
[if test $at_status != 0; then
|
||||||
|
$2
|
||||||
|
fi],
|
||||||
|
[SKIP_IF([test $at_status != 0])])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@@ -940,11 +957,11 @@ m4_define([AT_SKIP_IF_EXCEPTION_SUPPORT_IS_POOR],
|
|||||||
[[#include <iostream>
|
[[#include <iostream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
void foo()
|
void foo ()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
throw std::runtime_error("foo");
|
throw std::runtime_error ("foo");
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
@@ -953,11 +970,11 @@ void foo()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main ()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foo();
|
foo ();
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -396,7 +396,7 @@ AT_BISON_OPTION_PUSHDEFS([%skeleton "$1"])
|
|||||||
# properly to the linker, and is unable to save a file named this way.
|
# properly to the linker, and is unable to save a file named this way.
|
||||||
# Don't try with such compilers.
|
# Don't try with such compilers.
|
||||||
AT_DATA([\"\\\"\".c],
|
AT_DATA([\"\\\"\".c],
|
||||||
[[int main() { return 0; }
|
[[int main (void) { return 0; }
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AT_CHECK([AT_CXX_IF([$CXX $CXXFLAGS], [$CC $CFLAGS]) $CPPFLAGS \"\\\"\".c -o \"\\\"\" ||
|
AT_CHECK([AT_CXX_IF([$CXX $CXXFLAGS], [$CC $CFLAGS]) $CPPFLAGS \"\\\"\".c -o \"\\\"\" ||
|
||||||
|
|||||||
+25
-4
@@ -78,7 +78,7 @@ m4_pushdef([_AT_TEST],
|
|||||||
[
|
[
|
||||||
AT_SETUP([$1])
|
AT_SETUP([$1])
|
||||||
AT_KEYWORDS([api.value.type])
|
AT_KEYWORDS([api.value.type])
|
||||||
$7
|
|
||||||
AT_BISON_OPTION_PUSHDEFS([%debug $1 $2])
|
AT_BISON_OPTION_PUSHDEFS([%debug $1 $2])
|
||||||
AT_DATA_GRAMMAR([test.y],
|
AT_DATA_GRAMMAR([test.y],
|
||||||
[[%debug
|
[[%debug
|
||||||
@@ -104,9 +104,12 @@ start: $3;
|
|||||||
]AT_MAIN_DEFINE[
|
]AT_MAIN_DEFINE[
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AT_FULL_COMPILE([[test]])
|
AT_LANG_FOR_EACH_STD([
|
||||||
AT_PARSER_CHECK([[./test]], 0, [[$6
|
$7
|
||||||
|
AT_FULL_COMPILE([[test]])
|
||||||
|
AT_PARSER_CHECK([[./test]], 0, [[$6
|
||||||
]])
|
]])
|
||||||
|
])
|
||||||
|
|
||||||
AT_BISON_OPTION_POPDEFS
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
@@ -267,6 +270,24 @@ m4_foreach([b4_skel], [[yacc.c], [glr.c], [lalr1.cc], [glr.cc]],
|
|||||||
AT_VAL.build<std::string> ("two");],
|
AT_VAL.build<std::string> ("two");],
|
||||||
[10, two])
|
[10, two])
|
||||||
|
|
||||||
|
# Test a regression where we passed user types (we can include
|
||||||
|
# commas) to a CPP macro.
|
||||||
|
AT_TEST([%skeleton "]b4_skel["
|
||||||
|
%define api.value.type variant],
|
||||||
|
[%token <std::pair<int, int>> '1';
|
||||||
|
%token <std::pair<std::string, std::string>> '2';],
|
||||||
|
['1' '2'
|
||||||
|
{
|
||||||
|
std::cout << $1.first << ':' << $1.second << ", "
|
||||||
|
<< $2.first << ':' << $2.second << '\n';
|
||||||
|
}],
|
||||||
|
["12"],
|
||||||
|
[if (res == '1')
|
||||||
|
AT_VAL.build (std::make_pair (10, 11));
|
||||||
|
else if (res == '2')
|
||||||
|
AT_VAL.build (std::make_pair<std::string, std::string> ("two", "deux"));],
|
||||||
|
[10:11, two:deux])
|
||||||
|
|
||||||
# Move-only types.
|
# Move-only types.
|
||||||
AT_TEST([%skeleton "]b4_skel["
|
AT_TEST([%skeleton "]b4_skel["
|
||||||
%code requires { #include <memory> }
|
%code requires { #include <memory> }
|
||||||
@@ -282,7 +303,7 @@ m4_foreach([b4_skel], [[yacc.c], [glr.c], [lalr1.cc], [glr.cc]],
|
|||||||
]AT_VAL[.emplace <std::unique_ptr<std::string>>
|
]AT_VAL[.emplace <std::unique_ptr<std::string>>
|
||||||
(std::make_unique <std::string> ("two"));]],
|
(std::make_unique <std::string> ("two"));]],
|
||||||
[10, two],
|
[10, two],
|
||||||
[AT_REQUIRE_CXX_VERSION(14)])])
|
[AT_REQUIRE_CXX_STD(14, [echo "$at_std not supported"; continue])])])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user