mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-16 14:15:13 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a100a3c4c1 | ||
|
|
b18ceb50f1 | ||
|
|
ff4d67ede8 | ||
|
|
465babb635 | ||
|
|
6a28e6d412 | ||
|
|
f4495da337 | ||
|
|
dbaed0bbf2 | ||
|
|
78c7fb6460 | ||
|
|
da29809969 | ||
|
|
87e4895189 |
+1
-1
@@ -1 +1 @@
|
|||||||
3.6
|
3.6.1
|
||||||
|
|||||||
+57
-39
@@ -69,53 +69,53 @@ jobs:
|
|||||||
|
|
||||||
# Start with three completely different environments, to get errors asap.
|
# Start with three completely different environments, to get errors asap.
|
||||||
|
|
||||||
- name: "GCC 9 -O3"
|
- name: "GCC 10 -O3"
|
||||||
stage: check
|
stage: check
|
||||||
os: linux
|
os: linux
|
||||||
dist: bionic
|
dist: bionic
|
||||||
addons: &gcc9
|
addons: &gcc10
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
# See https://github.com/travis-ci/apt-source-safelist/issues/410.
|
# See https://github.com/travis-ci/apt-source-safelist/issues/410.
|
||||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||||
packages: g++-9
|
packages: g++-10
|
||||||
env:
|
env:
|
||||||
- CC=gcc-9
|
- CC=gcc-10
|
||||||
- CXX=g++-9
|
- CXX=g++-10
|
||||||
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
||||||
|
|
||||||
# ASAN is time consuming, and we timeout the 50min granted by
|
# 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.
|
# Travis if we run all the tests in one go. Run in two parts.
|
||||||
- name: "Clang 9 libc++ and ASAN part 1"
|
- name: "Clang 10 libc++ and ASAN part 1"
|
||||||
stage: check
|
stage: check
|
||||||
os: linux
|
os: linux
|
||||||
dist: bionic
|
dist: bionic
|
||||||
addons: &clang9
|
addons: &clang10
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
# See https://github.com/travis-ci/apt-source-safelist/issues/410.
|
# See https://github.com/travis-ci/apt-source-safelist/issues/410.
|
||||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||||
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
|
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
|
||||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||||
packages:
|
packages:
|
||||||
- clang-9
|
- clang-10
|
||||||
- libc++-9-dev
|
- libc++-10-dev
|
||||||
- libc++abi-9-dev
|
- libc++abi-10-dev
|
||||||
env:
|
env:
|
||||||
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
||||||
- CC='clang-9 -fsanitize=address'
|
- CC='clang-10 -fsanitize=address'
|
||||||
- CXX='clang++-9 -fsanitize=address -stdlib=libc++'
|
- CXX='clang++-10 -fsanitize=address -stdlib=libc++'
|
||||||
- PART=1
|
- PART=1
|
||||||
|
|
||||||
- name: "Clang 9 libc++ and ASAN part 2"
|
- name: "Clang 10 libc++ and ASAN part 2"
|
||||||
stage: check
|
stage: check
|
||||||
os: linux
|
os: linux
|
||||||
dist: bionic
|
dist: bionic
|
||||||
addons: *clang9
|
addons: *clang10
|
||||||
env:
|
env:
|
||||||
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
# Do not use ASAN with ubuntu's libc++: https://bugs.llvm.org/show_bug.cgi?id=17379
|
||||||
- CC='clang-9 -fsanitize=address'
|
- CC='clang-10 -fsanitize=address'
|
||||||
- CXX='clang++-9 -fsanitize=address -stdlib=libc++'
|
- CXX='clang++-10 -fsanitize=address -stdlib=libc++'
|
||||||
- PART=2
|
- PART=2
|
||||||
|
|
||||||
- name: "ICC"
|
- name: "ICC"
|
||||||
@@ -135,46 +135,41 @@ jobs:
|
|||||||
packages:
|
packages:
|
||||||
- intel-oneapi-icc
|
- intel-oneapi-icc
|
||||||
|
|
||||||
## ------- ##
|
- name: "ARM64: GCC 10 -O3 part 1"
|
||||||
## First. ##
|
|
||||||
## ------- ##
|
|
||||||
|
|
||||||
# Start with three completely different environments, to get
|
|
||||||
# errors asap.
|
|
||||||
|
|
||||||
- name: "ARM64: GCC 9 -O3 part 1"
|
|
||||||
stage: check
|
stage: check
|
||||||
os: linux
|
os: linux
|
||||||
arch: arm64
|
arch: arm64
|
||||||
dist: bionic
|
dist: bionic
|
||||||
addons: *gcc9
|
addons: *gcc10
|
||||||
env:
|
env:
|
||||||
- CC=gcc-9
|
- CC=gcc-10
|
||||||
- CXX=g++-9
|
- CXX=g++-10
|
||||||
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
||||||
- PART=1
|
- PART=1
|
||||||
|
|
||||||
|
# GCC10 on PPC seems to be buggy.
|
||||||
|
# E.g., https://travis-ci.org/github/akimd/bison/jobs/687812428.
|
||||||
- name: "PPC64le: GCC 9 part 1"
|
- name: "PPC64le: GCC 9 part 1"
|
||||||
stage: check
|
stage: check
|
||||||
os: linux
|
os: linux
|
||||||
arch: ppc64le
|
arch: ppc64le
|
||||||
dist: bionic
|
dist: bionic
|
||||||
addons: *gcc9
|
addons: *gcc10
|
||||||
env:
|
env:
|
||||||
- CC=gcc-9
|
- CC=gcc-9
|
||||||
- CXX=g++-9
|
- CXX=g++-9
|
||||||
- CONFIGUREFLAGS='CFLAGS=-O3 CXXFLAGS=-O3'
|
- CONFIGUREFLAGS='CFLAGS=-O3 CXXFLAGS=-O3'
|
||||||
- PART=1
|
- PART=1
|
||||||
|
|
||||||
- name: "s390x: GCC 9 part 1"
|
- name: "s390x: GCC 10 part 1"
|
||||||
stage: check
|
stage: check
|
||||||
os: linux
|
os: linux
|
||||||
arch: s390x
|
arch: s390x
|
||||||
dist: bionic
|
dist: bionic
|
||||||
addons: *gcc9
|
addons: *gcc10
|
||||||
env:
|
env:
|
||||||
- CC=gcc-9
|
- CC=gcc-10
|
||||||
- CXX=g++-9
|
- CXX=g++-10
|
||||||
- CONFIGUREFLAGS='CFLAGS=-O3 CXXFLAGS=-O3'
|
- CONFIGUREFLAGS='CFLAGS=-O3 CXXFLAGS=-O3'
|
||||||
- PART=1
|
- PART=1
|
||||||
|
|
||||||
@@ -182,15 +177,19 @@ jobs:
|
|||||||
## GCC. ##
|
## GCC. ##
|
||||||
## ----- ##
|
## ----- ##
|
||||||
|
|
||||||
- name: "GCC 8 with sanitizers part 1"
|
- name: "GCC 9 with sanitizers part 1"
|
||||||
|
stage: check
|
||||||
os: linux
|
os: linux
|
||||||
dist: bionic
|
dist: bionic
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages: g++-8
|
sources:
|
||||||
|
# See https://github.com/travis-ci/apt-source-safelist/issues/410.
|
||||||
|
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||||
|
packages: g++-9
|
||||||
env:
|
env:
|
||||||
- CC='gcc-8 -fsanitize=undefined,address -fno-omit-frame-pointer'
|
- CC='gcc-9 -fsanitize=undefined,address -fno-omit-frame-pointer'
|
||||||
- CXX='g++-8 -fsanitize=undefined,address -fno-omit-frame-pointer'
|
- CXX='g++-9 -fsanitize=undefined,address -fno-omit-frame-pointer'
|
||||||
- CONFIGUREFLAGS='CFLAGS=-O1 CXXFLAGS=-O1'
|
- CONFIGUREFLAGS='CFLAGS=-O1 CXXFLAGS=-O1'
|
||||||
- PART=1
|
- PART=1
|
||||||
|
|
||||||
@@ -292,7 +291,27 @@ jobs:
|
|||||||
## Clang. ##
|
## Clang. ##
|
||||||
## ------- ##
|
## ------- ##
|
||||||
|
|
||||||
- name: "Clang 8 -O3"
|
- name: "Clang 9 -O3"
|
||||||
|
stage: check
|
||||||
|
os: linux
|
||||||
|
dist: bionic
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
# See https://github.com/travis-ci/apt-source-safelist/issues/410.
|
||||||
|
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||||
|
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
|
||||||
|
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||||
|
packages:
|
||||||
|
- clang-9
|
||||||
|
- libc++-9-dev
|
||||||
|
- libc++abi-9-dev
|
||||||
|
env:
|
||||||
|
- CC='clang-9'
|
||||||
|
- CXX='clang++-9 -stdlib=libc++'
|
||||||
|
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
||||||
|
|
||||||
|
- name: "Clang 8"
|
||||||
stage: check
|
stage: check
|
||||||
os: linux
|
os: linux
|
||||||
dist: bionic
|
dist: bionic
|
||||||
@@ -305,7 +324,6 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
- CC=clang-8
|
- CC=clang-8
|
||||||
- CXX='clang++-8 -stdlib=libc++'
|
- CXX='clang++-8 -stdlib=libc++'
|
||||||
- CONFIGUREFLAGS='CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3'
|
|
||||||
|
|
||||||
- name: "Clang 7"
|
- name: "Clang 7"
|
||||||
stage: check
|
stage: check
|
||||||
|
|||||||
@@ -127,3 +127,7 @@ gen-ChangeLog:
|
|||||||
--since=$(gen_start_date) > $$cl.tmp && \
|
--since=$(gen_start_date) > $$cl.tmp && \
|
||||||
mv -f $$cl.tmp $$cl; \
|
mv -f $$cl.tmp $$cl; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Useful to debug.
|
||||||
|
.c.i:
|
||||||
|
$(CC) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -o $@ -E $<
|
||||||
|
|||||||
@@ -1,9 +1,23 @@
|
|||||||
GNU Bison NEWS
|
GNU Bison NEWS
|
||||||
|
|
||||||
|
* Noteworthy changes in release 3.6.2 (2020-05-17) [stable]
|
||||||
|
|
||||||
|
** Bug fixes
|
||||||
|
|
||||||
|
Some tests were fixed.
|
||||||
|
|
||||||
|
When token aliases contain comment delimiters:
|
||||||
|
|
||||||
|
%token FOO "/* foo */"
|
||||||
|
|
||||||
|
bison used to emit "nested" comments, which is invalid C.
|
||||||
|
|
||||||
* Noteworthy changes in release 3.6.1 (2020-05-10) [stable]
|
* Noteworthy changes in release 3.6.1 (2020-05-10) [stable]
|
||||||
|
|
||||||
** Bug fixes
|
** Bug fixes
|
||||||
|
|
||||||
|
Restored ANSI-C compliance in yacc.c.
|
||||||
|
|
||||||
GNU readline portability issues.
|
GNU readline portability issues.
|
||||||
|
|
||||||
In C++, yy::parser::symbol_name is now a public member, as was intended.
|
In C++, yy::parser::symbol_name is now a public member, as was intended.
|
||||||
|
|||||||
@@ -128,6 +128,25 @@ Rici:
|
|||||||
> At a minimum, the fact that yyclearin does not invoke the %destructor
|
> At a minimum, the fact that yyclearin does not invoke the %destructor
|
||||||
> should be highlighted in the documentation, since it is not at all obvious.
|
> should be highlighted in the documentation, since it is not at all obvious.
|
||||||
|
|
||||||
|
** Issues in i18n
|
||||||
|
|
||||||
|
Les catégories d'avertissements incluent :
|
||||||
|
conflicts-sr conflits S/R (activé par défaut)
|
||||||
|
conflicts-rr conflits R/R (activé par défaut)
|
||||||
|
dangling-alias l'alias chaîne n'est pas attaché à un symbole
|
||||||
|
deprecated construction obsolète
|
||||||
|
empty-rule règle vide sans %empty
|
||||||
|
midrule-values valeurs de règle intermédiaire non définies ou inutilisées
|
||||||
|
precedence priorité et associativité inutiles
|
||||||
|
yacc incompatibilités avec POSIX Yacc
|
||||||
|
other tous les autres avertissements (activé par défaut)
|
||||||
|
all tous les avertissements sauf « dangling-alias » et « yacc »
|
||||||
|
no-CATEGORY désactiver les avertissements dans CATEGORIE
|
||||||
|
none désactiver tous les avertissements
|
||||||
|
error[=CATEGORY] traiter les avertissements comme des erreurs
|
||||||
|
|
||||||
|
Line -1 and -3 should mention CATEGORIE, not CATEGORY.
|
||||||
|
|
||||||
* Bison 3.8
|
* Bison 3.8
|
||||||
** Unit rules / Injection rules (Akim Demaille)
|
** Unit rules / Injection rules (Akim Demaille)
|
||||||
Maybe we could expand unit rules (or "injections", see
|
Maybe we could expand unit rules (or "injections", see
|
||||||
|
|||||||
@@ -73,6 +73,11 @@ def diff_to_re(match):
|
|||||||
is_diff = True
|
is_diff = True
|
||||||
to.append(l)
|
to.append(l)
|
||||||
if is_diff:
|
if is_diff:
|
||||||
|
# Do not run s//SOMETHING/g (with an emty pattern), that won't
|
||||||
|
# work well...
|
||||||
|
if frm == []:
|
||||||
|
trace("no from for", match.group(1))
|
||||||
|
return
|
||||||
frm = "\n".join(frm)
|
frm = "\n".join(frm)
|
||||||
to = "\n".join(to)
|
to = "\n".join(to)
|
||||||
subst[frm] = to
|
subst[frm] = to
|
||||||
@@ -112,4 +117,6 @@ def process(logfile):
|
|||||||
|
|
||||||
for logfile in args.logs:
|
for logfile in args.logs:
|
||||||
trace("FILE:", logfile)
|
trace("FILE:", logfile)
|
||||||
|
if os.path.isdir(logfile):
|
||||||
|
logfile = os.path.join(logfile, 'testsuite.log')
|
||||||
process(logfile)
|
process(logfile)
|
||||||
|
|||||||
@@ -22,10 +22,14 @@
|
|||||||
# Put TEXT in comment. Avoid trailing spaces: don't indent empty lines.
|
# Put TEXT in comment. Avoid trailing spaces: don't indent empty lines.
|
||||||
# Avoid adding indentation to the first line, as the indentation comes
|
# Avoid adding indentation to the first line, as the indentation comes
|
||||||
# from OPEN. That's why we don't patsubst([$1], [^\(.\)], [ \1]).
|
# from OPEN. That's why we don't patsubst([$1], [^\(.\)], [ \1]).
|
||||||
|
# Turn "*/" in TEXT into "* /" so that we don't unexpectedly close
|
||||||
|
# the comments before its end.
|
||||||
#
|
#
|
||||||
# Prefix all the output lines with PREFIX.
|
# Prefix all the output lines with PREFIX.
|
||||||
m4_define([_b4_comment],
|
m4_define([_b4_comment],
|
||||||
[$2[]m4_bpatsubst(m4_expand([[$1]]), [
|
[$2[]m4_bpatsubsts(m4_expand([$1]),
|
||||||
|
[[*]/], [*\\/],
|
||||||
|
[/[*]], [/\\*], [
|
||||||
\(.\)], [
|
\(.\)], [
|
||||||
$3\1])$4])
|
$3\1])$4])
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ semantic value.
|
|||||||
|
|
||||||
Run as `./simple`.
|
Run as `./simple`.
|
||||||
|
|
||||||
Extracted from the documentation: "A Simple C++ Example".
|
Extracted from the documentation: [A Simple C++
|
||||||
https://www.gnu.org/software/bison/manual/html_node/A-Simple-C_002b_002b-Example.html
|
Example](https://www.gnu.org/software/bison/manual/html_node/A-Simple-C_002b_002b-Example.html).
|
||||||
|
|
||||||
## variant.yy - Self-contained example in C++98
|
## variant.yy - Self-contained example in C++98
|
||||||
A variation of simple.yy, in C++98.
|
A variation of simple.yy, in C++98.
|
||||||
@@ -36,8 +36,8 @@ starting point for a clean parser in C++. The previous examples are better
|
|||||||
introductory examples, and the C examples are also useful introductory
|
introductory examples, and the C examples are also useful introductory
|
||||||
examples.
|
examples.
|
||||||
|
|
||||||
Extracted from the documentation: "A Complete C++ Example".
|
Extracted from the documentation: [A Complete C++
|
||||||
https://www.gnu.org/software/bison/manual/html_node/A-Complete-C_002b_002b-Example.html
|
Example](https://www.gnu.org/software/bison/manual/html_node/A-Complete-C_002b_002b-Example.html).
|
||||||
|
|
||||||
<!---
|
<!---
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ saw the traditional implementation in C, please first read
|
|||||||
examples/c/lexcalc, which can be seen as a C precursor of this example.
|
examples/c/lexcalc, which can be seen as a C precursor of this example.
|
||||||
|
|
||||||
Read the corresponding chapter in the documentation: "A Complete C++
|
Read the corresponding chapter in the documentation: "A Complete C++
|
||||||
Example". It is also available on line (maybe with a different version of
|
Example". It is also available [on
|
||||||
Bison):
|
line](https://www.gnu.org/software/bison/manual/html_node/A-Complete-C_002b_002b-Example.html)
|
||||||
https://www.gnu.org/software/bison/manual/html_node/A-Complete-C_002b_002b-Example.html
|
(maybe with a different version of Bison).
|
||||||
|
|
||||||
To use it, copy this directory into some work directory, and run `make` to
|
To use it, copy this directory into some work directory, and run `make` to
|
||||||
compile the executable, and try it. It is a simple calculator which accepts
|
compile the executable, and try it. It is a simple calculator which accepts
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ The first example is that of a simple double-precision Reverse Polish
|
|||||||
Notation calculator (a calculator using postfix operators). This example
|
Notation calculator (a calculator using postfix operators). This example
|
||||||
provides a good starting point, since operator precedence is not an issue.
|
provides a good starting point, since operator precedence is not an issue.
|
||||||
|
|
||||||
Extracted from the documentation: "Reverse Polish Notation Calculator"
|
Extracted from the documentation: [Reverse Polish Notation
|
||||||
https://www.gnu.org/software/bison/manual/html_node/RPN-Calc.html
|
Calculator](https://www.gnu.org/software/bison/manual/html_node/RPN-Calc.html).
|
||||||
|
|
||||||
## calc - Simple Calculator
|
## calc - Simple Calculator
|
||||||
This example is slightly more complex than rpcalc: it features infix
|
This example is slightly more complex than rpcalc: it features infix
|
||||||
@@ -24,8 +24,8 @@ A more complete C example: a multi-function calculator. More complex than
|
|||||||
the previous example. Using precedence directives to support infix
|
the previous example. Using precedence directives to support infix
|
||||||
operators.
|
operators.
|
||||||
|
|
||||||
Extracted from the documentation: "Multi-Function Calculator: mfcalc".
|
Extracted from the documentation: [Multi-Function Calculator:
|
||||||
https://www.gnu.org/software/bison/manual/html_node/Multi_002dfunction-Calc.html
|
mfcalc](https://www.gnu.org/software/bison/manual/html_node/Multi_002dfunction-Calc.html).
|
||||||
|
|
||||||
## lexcalc - calculator with Flex and Bison
|
## lexcalc - calculator with Flex and Bison
|
||||||
The calculator with precedence directives and location tracking. It uses
|
The calculator with precedence directives and location tracking. It uses
|
||||||
|
|||||||
+1
-1
Submodule gnulib updated: 2ac33b29fc...ffbb0ced8b
+2
-2
@@ -161,8 +161,8 @@ int main()
|
|||||||
{
|
{
|
||||||
parser::symbol_type s = parser::make_INT (12);
|
parser::symbol_type s = parser::make_INT (12);
|
||||||
assert_eq (s.kind (), parser::symbol_kind::S_INT);
|
assert_eq (s.kind (), parser::symbol_kind::S_INT);
|
||||||
assert_eq (parser::symbol_name (s.kind ()), "\"int\"");
|
assert_eq (parser::symbol_name (s.kind ()), std::string ("\"int\""));
|
||||||
assert_eq (s.name (), "\"int\"");
|
assert_eq (s.name (), std::string ("\"int\""));
|
||||||
assert_eq (s.value.as<int> (), 12);
|
assert_eq (s.value.as<int> (), 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+18
-1
@@ -1352,8 +1352,20 @@ AT_BISON_CHECK([-fcaret input.y], [1], [],
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
# Clang chokes on some of our comments, because it tries to "parse"
|
||||||
|
# some documentation directives in the comments:
|
||||||
|
#
|
||||||
|
# input.c:166:50: error: '\a' command does not have a valid word argument [-Werror,-Wdocumentation]
|
||||||
|
# FAKE = 258 /* "fake [] \a\b\f\n\r\t\v\"'?\\[\\ ??!??'??(??)??-??/??<??=??> \001\001" */
|
||||||
|
# ~~^
|
||||||
AT_DATA_GRAMMAR([input.y],
|
AT_DATA_GRAMMAR([input.y],
|
||||||
[[%{
|
[[%code requires {
|
||||||
|
#if defined __clang__ && 10 <= __clang_major__
|
||||||
|
# pragma clang diagnostic ignored "-Wdocumentation"
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
%{
|
||||||
/* This is seen in GCC: a %{ and %} in middle of a comment. */
|
/* This is seen in GCC: a %{ and %} in middle of a comment. */
|
||||||
const char *foo = "So %{ and %} can be here too.";
|
const char *foo = "So %{ and %} can be here too.";
|
||||||
|
|
||||||
@@ -1424,6 +1436,11 @@ char quote[] = "@:>@@:>@,";
|
|||||||
/* Exercise quotes in strings. */
|
/* Exercise quotes in strings. */
|
||||||
%token FAKE "fake @<:@@:>@ \a\b\f\n\r\t\v\"\'\?\\\u005B\U0000005c ??!??'??(??)??-??/??<??=??> \x1\1"
|
%token FAKE "fake @<:@@:>@ \a\b\f\n\r\t\v\"\'\?\\\u005B\U0000005c ??!??'??(??)??-??/??<??=??> \x1\1"
|
||||||
|
|
||||||
|
/* Beware of the generated comments that embed string aliases that
|
||||||
|
might close the comment. */
|
||||||
|
%token COMMENT_CLOSE "*/"
|
||||||
|
%token COMMENT "/* comment */"
|
||||||
|
|
||||||
%%
|
%%
|
||||||
/* Exercise M4 quoting: '@:>@@:>@', @<:@, 1. */
|
/* Exercise M4 quoting: '@:>@@:>@', @<:@, 1. */
|
||||||
exp: '@<:@' '\1' two '$' '@' '{' oline output.or.oline.opt
|
exp: '@<:@' '\1' two '$' '@' '{' oline output.or.oline.opt
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ TESTSUITE_AT = \
|
|||||||
%D%/java.at \
|
%D%/java.at \
|
||||||
%D%/javapush.at \
|
%D%/javapush.at \
|
||||||
%D%/local.at \
|
%D%/local.at \
|
||||||
|
%D%/m4.at \
|
||||||
%D%/named-refs.at \
|
%D%/named-refs.at \
|
||||||
%D%/output.at \
|
%D%/output.at \
|
||||||
%D%/package.m4 \
|
%D%/package.m4 \
|
||||||
|
|||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
# Basic m4 macros. -*- Autotest -*-
|
||||||
|
|
||||||
|
# Copyright (C) 2020 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
AT_BANNER([[M4 Macros.]])
|
||||||
|
|
||||||
|
|
||||||
|
AT_SETUP([Generating Comments])
|
||||||
|
|
||||||
|
AT_DATA([input.y],
|
||||||
|
[%%
|
||||||
|
exp:
|
||||||
|
])
|
||||||
|
|
||||||
|
AT_DATA([input.m4],
|
||||||
|
[[m4@&t@_include(b4_skeletonsdir/[c.m4])
|
||||||
|
|
||||||
|
b4_output_begin([output.txt])
|
||||||
|
b4_comment([["/* () */"]])
|
||||||
|
b4_comment([["/* ( */"]])
|
||||||
|
b4_comment([["/* ) */"]])
|
||||||
|
b4_output_end([output.txt])
|
||||||
|
]])
|
||||||
|
|
||||||
|
AT_BISON_CHECK([-S ./input.m4 input.y])
|
||||||
|
|
||||||
|
AT_CHECK([cat output.txt], [],
|
||||||
|
[/* "/\* () *\/" */
|
||||||
|
/* "/\* ( *\/" */
|
||||||
|
/* "/\* ) *\/" */
|
||||||
|
])
|
||||||
|
|
||||||
|
AT_CLEANUP
|
||||||
+17
-6
@@ -372,8 +372,19 @@ m4_pushdef([AT_TEST],
|
|||||||
|
|
||||||
AT_BISON_OPTION_PUSHDEFS([$1])
|
AT_BISON_OPTION_PUSHDEFS([$1])
|
||||||
|
|
||||||
|
|
||||||
|
# Clang chokes on some of our comments, because it tries to "parse"
|
||||||
|
# some documentation directives in the comments:
|
||||||
|
#
|
||||||
|
# input.c:131:48: error: '\a' command does not have a valid word argument [-Werror,-Wdocumentation]
|
||||||
|
# SPECIAL = 261 /* "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" */
|
||||||
|
# ~~^
|
||||||
AT_DATA_GRAMMAR([input.y],
|
AT_DATA_GRAMMAR([input.y],
|
||||||
[%{
|
[%{
|
||||||
|
#if defined __clang__ && 10 <= __clang_major__
|
||||||
|
# pragma clang diagnostic ignored "-Wdocumentation"
|
||||||
|
#endif
|
||||||
|
|
||||||
]AT_YYERROR_DECLARE[
|
]AT_YYERROR_DECLARE[
|
||||||
]AT_YYLEX_DECLARE[
|
]AT_YYLEX_DECLARE[
|
||||||
%}
|
%}
|
||||||
@@ -398,14 +409,14 @@ exp: ]AT_ERROR_VERBOSE_IF(["\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"], ["
|
|||||||
# C-string literal. Also notice that unnecessary escaping, such as "\?", from
|
# C-string literal. Also notice that unnecessary escaping, such as "\?", from
|
||||||
# the user specification is eliminated.
|
# the user specification is eliminated.
|
||||||
AT_BISON_CHECK([-fcaret -o input.c input.y], [[0]], [[]],
|
AT_BISON_CHECK([-fcaret -o input.c input.y], [[0]], [[]],
|
||||||
[[input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother]
|
[[input.y:26.8-14: warning: symbol SPECIAL redeclared [-Wother]
|
||||||
22 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
26 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
||||||
| ^~~~~~~
|
| ^~~~~~~
|
||||||
input.y:21.8-14: note: previous declaration
|
input.y:25.8-14: note: previous declaration
|
||||||
21 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
25 | %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]
|
input.y:26.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??!"
|
26 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
|
||||||
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Basic M4 macros.
|
||||||
|
m4_include([m4.at])
|
||||||
|
|
||||||
# Resistance to user bugs.
|
# Resistance to user bugs.
|
||||||
m4_include([input.at])
|
m4_include([input.at])
|
||||||
|
|||||||
Reference in New Issue
Block a user