mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-08-14 13:15:14 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed02d34fbc | ||
|
|
8b0b295569 | ||
|
|
59a108c0a6 | ||
|
|
83ebc8bdb6 | ||
|
|
8023b3153a | ||
|
|
b23ca37ed2 | ||
|
|
bb5e4b659b | ||
|
|
bc8ec1d7bf | ||
|
|
665c5d688c | ||
|
|
53d379b905 | ||
|
|
aa85bfe3a7 | ||
|
|
5ec9c99662 | ||
|
|
36cae8e752 | ||
|
|
7498ede3ab | ||
|
|
27104acdbe | ||
|
|
7b3368a155 | ||
|
|
ec08b369ec | ||
|
|
05b70f47e8 | ||
|
|
626d2f2dca | ||
|
|
5c797b1627 | ||
|
|
ac692b572a | ||
|
|
2f208ee43a |
+1
-1
@@ -1 +1 @@
|
|||||||
3.2.90
|
3.3
|
||||||
|
|||||||
@@ -1,6 +1,65 @@
|
|||||||
GNU Bison NEWS
|
GNU Bison NEWS
|
||||||
|
|
||||||
* Noteworthy changes in release 3.2.91 (2019-01-19) [beta]
|
* Noteworthy changes in release 3.3.1 (2019-01-27) [stable]
|
||||||
|
|
||||||
|
** Changes
|
||||||
|
|
||||||
|
The option -y/--yacc used to imply -Werror=yacc, which turns uses of Bison
|
||||||
|
extensions into errors. It now makes them simple warnings (-Wyacc).
|
||||||
|
|
||||||
|
* Noteworthy changes in release 3.3 (2019-01-26) [stable]
|
||||||
|
|
||||||
|
A new mailing list was created, Bison Announce. It is low traffic, and is
|
||||||
|
only about announcing new releases and important messages (e.g., polls
|
||||||
|
about major decisions to make).
|
||||||
|
|
||||||
|
https://lists.gnu.org/mailman/listinfo/bison-announce
|
||||||
|
|
||||||
|
** Backward incompatible changes
|
||||||
|
|
||||||
|
Support for DJGPP, which has been unmaintained and untested for years, is
|
||||||
|
removed.
|
||||||
|
|
||||||
|
** Deprecated features
|
||||||
|
|
||||||
|
A new feature, --update (see below) helps adjusting existing grammars to
|
||||||
|
deprecations.
|
||||||
|
|
||||||
|
*** Deprecated directives
|
||||||
|
|
||||||
|
The %error-verbose directive is deprecated in favor of '%define
|
||||||
|
parse.error verbose' since Bison 3.0, but no warning was issued.
|
||||||
|
|
||||||
|
The '%name-prefix "xx"' directive is deprecated in favor of '%define
|
||||||
|
api.prefix {xx}' since Bison 3.0, but no warning was issued. These
|
||||||
|
directives are slightly different, you might need to adjust your code.
|
||||||
|
%name-prefix renames only symbols with external linkage, while api.prefix
|
||||||
|
also renames types and macros, including YYDEBUG, YYTOKENTYPE,
|
||||||
|
yytokentype, YYSTYPE, YYLTYPE, etc.
|
||||||
|
|
||||||
|
Users of Flex that move from '%name-prefix "xx"' to '%define api.prefix
|
||||||
|
{xx}' will typically have to update YY_DECL from
|
||||||
|
|
||||||
|
#define YY_DECL int xxlex (YYSTYPE *yylval, YYLTYPE *yylloc)
|
||||||
|
|
||||||
|
to
|
||||||
|
|
||||||
|
#define YY_DECL int xxlex (XXSTYPE *yylval, XXLTYPE *yylloc)
|
||||||
|
|
||||||
|
*** Deprecated %define variable names
|
||||||
|
|
||||||
|
The following variables, mostly related to parsers in Java, have been
|
||||||
|
renamed for consistency. Backward compatibility is ensured, but upgrading
|
||||||
|
is recommended.
|
||||||
|
|
||||||
|
abstract -> api.parser.abstract
|
||||||
|
annotations -> api.parser.annotations
|
||||||
|
extends -> api.parser.extends
|
||||||
|
final -> api.parser.final
|
||||||
|
implements -> api.parser.implements
|
||||||
|
parser_class_name -> api.parser.class
|
||||||
|
public -> api.parser.public
|
||||||
|
strictfp -> api.parser.strictfp
|
||||||
|
|
||||||
** New features
|
** New features
|
||||||
|
|
||||||
@@ -56,62 +115,14 @@ GNU Bison NEWS
|
|||||||
%%
|
%%
|
||||||
exp:;
|
exp:;
|
||||||
|
|
||||||
* Noteworthy changes in release 3.2.90 (2019-01-12) [beta]
|
|
||||||
|
|
||||||
** Backward incompatible changes
|
|
||||||
|
|
||||||
Support for DJGPP, which has been unmaintained and untested for years, is
|
|
||||||
removed.
|
|
||||||
|
|
||||||
** Deprecated features
|
|
||||||
|
|
||||||
*** Deprecated directives
|
|
||||||
|
|
||||||
The %error-verbose directive is deprecated in favor of '%define
|
|
||||||
parse.error verbose' since Bison 3.0, but no warning was issued.
|
|
||||||
|
|
||||||
The '%name-prefix "xx"' directive is deprecated in favor of '%define
|
|
||||||
api.prefix {xx}' since Bison 3.0, but no warning was issued. These
|
|
||||||
directives are slightly different, you might need to adjust your code.
|
|
||||||
%name-prefix renames only symbols with external linkage, while api.prefix
|
|
||||||
also renames types and macros, including @code{YYDEBUG},
|
|
||||||
@code{YYTOKENTYPE}, @code{yytokentype}, @code{YYSTYPE}, @code{YYLTYPE},
|
|
||||||
etc.
|
|
||||||
|
|
||||||
Users of Flex that move from '%name-prefix "xx"' to '%define api.prefix
|
|
||||||
{xx}' will typically have to update YY_DECL from
|
|
||||||
|
|
||||||
#define YY_DECL int xxlex (YYSTYPE *yylval, YYLTYPE *yylloc)
|
|
||||||
|
|
||||||
to
|
|
||||||
|
|
||||||
#define YY_DECL int xxlex (XXSTYPE *yylval, XXLTYPE *yylloc)
|
|
||||||
|
|
||||||
*** Deprecated %define variable names
|
|
||||||
|
|
||||||
The following variables, mostly related to parsers in Java, have been
|
|
||||||
renamed for consistency. Backward compatibility is ensured, but upgrading
|
|
||||||
is recommended.
|
|
||||||
|
|
||||||
abstract -> api.parser.abstract
|
|
||||||
annotations -> api.parser.annotations
|
|
||||||
extends -> api.parser.extends
|
|
||||||
final -> api.parser.final
|
|
||||||
implements -> api.parser.implements
|
|
||||||
parser_class_name -> api.parser.class
|
|
||||||
public -> api.parser.public
|
|
||||||
strictfp -> api.parser.strictfp
|
|
||||||
|
|
||||||
** New features
|
|
||||||
|
|
||||||
*** Bison is now relocatable
|
*** Bison is now relocatable
|
||||||
|
|
||||||
If you pass '--enable-relocatable' to 'configure', Bison is relocatable.
|
If you pass '--enable-relocatable' to 'configure', Bison is relocatable.
|
||||||
|
|
||||||
A relocatable program can be moved or copied to a different location on
|
A relocatable program can be moved or copied to a different location on
|
||||||
the file system. It can also be used through mount points for network
|
the file system. It can also be used through mount points for network
|
||||||
sharing. It is possible to make symlinks to the installed and moved
|
sharing. It is possible to make symbolic links to the installed and moved
|
||||||
programs, and invoke them through the symlink.
|
programs, and invoke them through the symbolic link.
|
||||||
|
|
||||||
*** %expect and %expect-rr modifiers on individual rules
|
*** %expect and %expect-rr modifiers on individual rules
|
||||||
|
|
||||||
@@ -190,7 +201,7 @@ GNU Bison NEWS
|
|||||||
*** C++: Actual token constructors
|
*** C++: Actual token constructors
|
||||||
|
|
||||||
When variants and token constructors are enabled, in addition to the
|
When variants and token constructors are enabled, in addition to the
|
||||||
type-safe named token constructors (make_ID, amke_INT, etc.), we now
|
type-safe named token constructors (make_ID, make_INT, etc.), we now
|
||||||
generate genuine constructors for symbol_type.
|
generate genuine constructors for symbol_type.
|
||||||
|
|
||||||
For instance with these declarations
|
For instance with these declarations
|
||||||
@@ -307,7 +318,7 @@ GNU Bison NEWS
|
|||||||
where TAG denotes a type tag such as ‘<ival>’, ID denotes an identifier
|
where TAG denotes a type tag such as ‘<ival>’, ID denotes an identifier
|
||||||
such as ‘NUM’, NUMBER a decimal or hexadecimal integer such as ‘300’ or
|
such as ‘NUM’, NUMBER a decimal or hexadecimal integer such as ‘300’ or
|
||||||
‘0x12d’, CHAR a character literal such as ‘'+'’, and STRING a string
|
‘0x12d’, CHAR a character literal such as ‘'+'’, and STRING a string
|
||||||
literal such as ‘"number"’. The postfix quantifiers are ‘?’ (zero or
|
literal such as ‘"number"’. The post-fix quantifiers are ‘?’ (zero or
|
||||||
one), ‘*’ (zero or more) and ‘+’ (one or more).
|
one), ‘*’ (zero or more) and ‘+’ (one or more).
|
||||||
|
|
||||||
* Noteworthy changes in release 3.2.4 (2018-12-24) [stable]
|
* Noteworthy changes in release 3.2.4 (2018-12-24) [stable]
|
||||||
@@ -3464,10 +3475,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
LocalWords: pragmas noreturn untyped Rozenman unexpanded Wojciech Polak
|
LocalWords: pragmas noreturn untyped Rozenman unexpanded Wojciech Polak
|
||||||
LocalWords: Alexandre MERCHANTABILITY yytype emplace ptr automove lvalues
|
LocalWords: Alexandre MERCHANTABILITY yytype emplace ptr automove lvalues
|
||||||
LocalWords: nonterminal yy args Pragma dereference yyformat rhs docdir
|
LocalWords: nonterminal yy args Pragma dereference yyformat rhs docdir
|
||||||
LocalWords: Redeclarations rpcalc Autoconf YFLAGS Makefiles PROG
|
LocalWords: Redeclarations rpcalc Autoconf YFLAGS Makefiles PROG DECL num
|
||||||
LocalWords: Heimbigner AST src ast Makefile srcdir MinGW
|
LocalWords: Heimbigner AST src ast Makefile srcdir MinGW xxlex XXSTYPE
|
||||||
|
LocalWords: XXLTYPE strictfp IDEs ffixit fdiagnostics parseable fixits
|
||||||
|
LocalWords: Wdeprecated yytext Variadic variadic yyrhs yyphrs RCS README
|
||||||
|
LocalWords: noexcept constexpr ispell american
|
||||||
|
|
||||||
Local Variables:
|
Local Variables:
|
||||||
|
ispell-dictionary: "american"
|
||||||
mode: outline
|
mode: outline
|
||||||
fill-column: 76
|
fill-column: 76
|
||||||
End:
|
End:
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
* Bison 3.4
|
* Bison 3.4
|
||||||
** injection rules
|
** injection rules
|
||||||
|
** glr.cc
|
||||||
|
move glr.c into the yy namespace
|
||||||
** improve syntax errors (UTF-8, internationalization)
|
** improve syntax errors (UTF-8, internationalization)
|
||||||
Bison depends on the current locale. For instance:
|
Bison depends on the current locale. For instance:
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -100,7 +100,7 @@ if test "$enable_gcc_warnings" = yes; then
|
|||||||
-Wpointer-arith -Wshadow
|
-Wpointer-arith -Wshadow
|
||||||
-Wwrite-strings'
|
-Wwrite-strings'
|
||||||
warn_c='-Wbad-function-cast -Wstrict-prototypes'
|
warn_c='-Wbad-function-cast -Wstrict-prototypes'
|
||||||
warn_cxx='-Wextra-semi -Wnoexcept -Wundefined-func-template'
|
warn_cxx='-Wextra-semi -Wnoexcept -Wundefined-func-template -Wweak-vtables'
|
||||||
# Warnings for the test suite only.
|
# Warnings for the test suite only.
|
||||||
#
|
#
|
||||||
# -fno-color-diagnostics: Clang's use of colors in the error
|
# -fno-color-diagnostics: Clang's use of colors in the error
|
||||||
|
|||||||
@@ -480,7 +480,9 @@ m4_popdef([b4_actions_])dnl
|
|||||||
|
|
||||||
# _b4_symbol_case(SYMBOL-NUM)
|
# _b4_symbol_case(SYMBOL-NUM)
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
# Issue a "case NUM" for SYMBOL-NUM.
|
# Issue a "case NUM" for SYMBOL-NUM. Ends with its EOL to make it
|
||||||
|
# easier to use with m4_map, but then, use []dnl to suppress the last
|
||||||
|
# one.
|
||||||
m4_define([_b4_symbol_case],
|
m4_define([_b4_symbol_case],
|
||||||
[case b4_symbol([$1], [number]): b4_symbol_tag_comment([$1])])
|
[case b4_symbol([$1], [number]): b4_symbol_tag_comment([$1])])
|
||||||
])
|
])
|
||||||
|
|||||||
+13
-4
@@ -77,11 +77,13 @@ m4_define([b4_cxx_portability],
|
|||||||
// Support noexcept when possible.
|
// Support noexcept when possible.
|
||||||
#if 201103L <= YY_CPLUSPLUS
|
#if 201103L <= YY_CPLUSPLUS
|
||||||
# define YY_NOEXCEPT noexcept
|
# define YY_NOEXCEPT noexcept
|
||||||
|
# define YY_NOTHROW
|
||||||
#else
|
#else
|
||||||
# define YY_NOEXCEPT
|
# define YY_NOEXCEPT
|
||||||
#endif[]dnl
|
# define YY_NOTHROW throw ()
|
||||||
|
#endif
|
||||||
|
|
||||||
// Support noexcept when possible.
|
// Support constexpr when possible.
|
||||||
#if 201703 <= YY_CPLUSPLUS
|
#if 201703 <= YY_CPLUSPLUS
|
||||||
# define YY_CONSTEXPR constexpr
|
# define YY_CONSTEXPR constexpr
|
||||||
#else
|
#else
|
||||||
@@ -217,7 +219,14 @@ m4_define([b4_public_types_declare],
|
|||||||
syntax_error (]b4_locations_if([const location_type& l, ])[const std::string& m)
|
syntax_error (]b4_locations_if([const location_type& l, ])[const std::string& m)
|
||||||
: std::runtime_error (m)]b4_locations_if([
|
: std::runtime_error (m)]b4_locations_if([
|
||||||
, location (l)])[
|
, location (l)])[
|
||||||
{}]b4_locations_if([
|
{}
|
||||||
|
|
||||||
|
syntax_error (const syntax_error& s)
|
||||||
|
: std::runtime_error (s.what ())]b4_locations_if([
|
||||||
|
, location (s.location)])[
|
||||||
|
{}
|
||||||
|
|
||||||
|
~syntax_error () YY_NOEXCEPT YY_NOTHROW;]b4_locations_if([
|
||||||
|
|
||||||
location_type location;])[
|
location_type location;])[
|
||||||
};
|
};
|
||||||
@@ -507,7 +516,7 @@ m4_define([b4_public_types_define],
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
# b4_tolen_constructor_define
|
# b4_token_constructor_define
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
# Define symbol constructors for all the value types.
|
# Define symbol constructors for all the value types.
|
||||||
# Use at class-level. Redefined in variant.hh.
|
# Use at class-level. Redefined in variant.hh.
|
||||||
|
|||||||
@@ -160,6 +160,9 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
|||||||
]b4_parser_class::~b4_parser_class[ ()
|
]b4_parser_class::~b4_parser_class[ ()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
]b4_parser_class[::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW
|
||||||
|
{}
|
||||||
|
|
||||||
int
|
int
|
||||||
]b4_parser_class[::operator() ()
|
]b4_parser_class[::operator() ()
|
||||||
{
|
{
|
||||||
@@ -246,9 +249,12 @@ b4_percent_code_get([[requires]])[
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
]m4_ifdef([b4_location_file],
|
]b4_cxx_portability[
|
||||||
|
]m4_ifdef([b4_location_include],
|
||||||
[[# include ]b4_location_include])[
|
[[# include ]b4_location_include])[
|
||||||
|
]b4_variant_if([b4_variant_includes])[
|
||||||
|
|
||||||
|
]b4_attribute_define[
|
||||||
]b4_null_define[
|
]b4_null_define[
|
||||||
|
|
||||||
// Whether we are compiled with exception support.
|
// Whether we are compiled with exception support.
|
||||||
@@ -263,6 +269,7 @@ b4_percent_code_get([[requires]])[
|
|||||||
]b4_YYDEBUG_define[
|
]b4_YYDEBUG_define[
|
||||||
|
|
||||||
]b4_namespace_open[
|
]b4_namespace_open[
|
||||||
|
|
||||||
]b4_bison_locations_if([m4_ifndef([b4_location_file],
|
]b4_bison_locations_if([m4_ifndef([b4_location_file],
|
||||||
[b4_location_define])])[
|
[b4_location_define])])[
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ b4_dollar_pushdef([yysym.value],
|
|||||||
[$1],
|
[$1],
|
||||||
[],
|
[],
|
||||||
[yysym.location])dnl
|
[yysym.location])dnl
|
||||||
_b4_symbol_case([$1])
|
_b4_symbol_case([$1])[]dnl
|
||||||
b4_syncline([b4_symbol([$1], [$2_line])], [b4_symbol([$1], [$2_file])])
|
b4_syncline([b4_symbol([$1], [$2_line])], [b4_symbol([$1], [$2_file])])
|
||||||
b4_symbol([$1], [$2])
|
b4_symbol([$1], [$2])
|
||||||
b4_syncline([@oline@], [@ofile@])
|
b4_syncline([@oline@], [@ofile@])
|
||||||
@@ -562,6 +562,8 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
]b4_parser_class::~b4_parser_class[ ()
|
]b4_parser_class::~b4_parser_class[ ()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
]b4_parser_class[::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW
|
||||||
|
{}
|
||||||
|
|
||||||
/*---------------.
|
/*---------------.
|
||||||
| Symbol types. |
|
| Symbol types. |
|
||||||
@@ -662,10 +664,12 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
std::ostream& yyoutput = yyo;
|
std::ostream& yyoutput = yyo;
|
||||||
YYUSE (yyoutput);
|
YYUSE (yyoutput);
|
||||||
symbol_number_type yytype = yysym.type_get ();
|
symbol_number_type yytype = yysym.type_get ();
|
||||||
|
#if defined __GNUC__ && ! defined __clang__ && ! defined __ICC && __GNUC__ * 100 + __GNUC_MINOR__ <= 408
|
||||||
// Avoid a (spurious) G++ 4.8 warning about "array subscript is
|
// Avoid a (spurious) G++ 4.8 warning about "array subscript is
|
||||||
// below array bounds".
|
// below array bounds".
|
||||||
if (yysym.empty ())
|
if (yysym.empty ())
|
||||||
std::abort ();
|
std::abort ();
|
||||||
|
#endif
|
||||||
yyo << (yytype < yyntokens_ ? "token" : "nterm")
|
yyo << (yytype < yyntokens_ ? "token" : "nterm")
|
||||||
<< ' ' << yytname_[yytype] << " ("]b4_locations_if([
|
<< ' ' << yytname_[yytype] << " ("]b4_locations_if([
|
||||||
<< yysym.location << ": "])[;
|
<< yysym.location << ": "])[;
|
||||||
|
|||||||
+16
-16
@@ -10272,8 +10272,8 @@ Print the name of the directory containing skeletons and XSLT.
|
|||||||
@item -u
|
@item -u
|
||||||
@item --update
|
@item --update
|
||||||
Update the grammar file (remove duplicates, update deprecated directives,
|
Update the grammar file (remove duplicates, update deprecated directives,
|
||||||
etc.). Leaves a backup of the original file with a @code{~} appended. For
|
etc.) and exit (i.e., do not generate any of the output files). Leaves a
|
||||||
instance:
|
backup of the original file with a @code{~} appended. For instance:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
@group
|
@group
|
||||||
@@ -10308,26 +10308,26 @@ See the documentation of @option{--feature=fixit} below for more details.
|
|||||||
|
|
||||||
@item -y
|
@item -y
|
||||||
@itemx --yacc
|
@itemx --yacc
|
||||||
Act more like the traditional Yacc command. This can cause different
|
Act more like the traditional @command{yacc} command. This can cause
|
||||||
diagnostics to be generated, and may change behavior in other minor
|
different diagnostics to be generated (it implies @option{-Wyacc}), and may
|
||||||
ways. Most importantly, imitate Yacc's output file name conventions,
|
change behavior in other minor ways. Most importantly, imitate Yacc's
|
||||||
so that the parser implementation file is called @file{y.tab.c}, and
|
output file name conventions, so that the parser implementation file is
|
||||||
the other outputs are called @file{y.output} and @file{y.tab.h}.
|
called @file{y.tab.c}, and the other outputs are called @file{y.output} and
|
||||||
Also, if generating a deterministic parser in C, generate
|
@file{y.tab.h}. Also, if generating a deterministic parser in C, generate
|
||||||
@code{#define} statements in addition to an @code{enum} to associate
|
@code{#define} statements in addition to an @code{enum} to associate token
|
||||||
token numbers with token names. Thus, the following shell script can
|
numbers with token names. Thus, the following shell script can substitute
|
||||||
substitute for Yacc, and the Bison distribution contains such a script
|
for Yacc, and the Bison distribution contains such a script for
|
||||||
for compatibility with POSIX:
|
compatibility with POSIX:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
bison -y "$@@"
|
bison -y "$@@"
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
The @option{-y}/@option{--yacc} option is intended for use with
|
The @option{-y}/@option{--yacc} option is intended for use with traditional
|
||||||
traditional Yacc grammars. If your grammar uses a Bison extension
|
Yacc grammars. If your grammar uses Bison extensions like
|
||||||
like @samp{%glr-parser}, Bison might not be Yacc-compatible even if
|
@samp{%glr-parser}, Bison might not be Yacc-compatible even if this option
|
||||||
this option is specified.
|
is specified.
|
||||||
|
|
||||||
@item -W [@var{category}]
|
@item -W [@var{category}]
|
||||||
@itemx --warnings[=@var{category}]
|
@itemx --warnings[=@var{category}]
|
||||||
|
|||||||
@@ -15,6 +15,9 @@
|
|||||||
# 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/>.
|
||||||
|
|
||||||
|
SHELL=/bin/sh
|
||||||
|
export SHELL
|
||||||
|
|
||||||
me=$(basename "$1" .test)
|
me=$(basename "$1" .test)
|
||||||
medir=$(dirname "$1" | sed -e 's,.*examples/,,')
|
medir=$(dirname "$1" | sed -e 's,.*examples/,,')
|
||||||
|
|
||||||
|
|||||||
+1
-1
Submodule gnulib updated: 315eb5ffc1...34881aff40
+9
-4
@@ -279,15 +279,18 @@ error_message (const location *loc, warnings flags, const char *prefix,
|
|||||||
*indent_ptr = pos;
|
*indent_ptr = pos;
|
||||||
else if (*indent_ptr > pos)
|
else if (*indent_ptr > pos)
|
||||||
fprintf (stderr, "%*s", *indent_ptr - pos, "");
|
fprintf (stderr, "%*s", *indent_ptr - pos, "");
|
||||||
indent_ptr = 0;
|
indent_ptr = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prefix)
|
if (prefix)
|
||||||
fprintf (stderr, "%s: ", prefix);
|
fprintf (stderr, "%s: ", prefix);
|
||||||
|
|
||||||
vfprintf (stderr, message, args);
|
vfprintf (stderr, message, args);
|
||||||
if (! (flags & silent))
|
/* Print the type of warning, only if this is not a sub message
|
||||||
|
(in which case the prefix is null). */
|
||||||
|
if (! (flags & silent) && prefix)
|
||||||
warnings_print_categories (flags, stderr);
|
warnings_print_categories (flags, stderr);
|
||||||
|
|
||||||
{
|
{
|
||||||
size_t l = strlen (message);
|
size_t l = strlen (message);
|
||||||
if (l < 2 || message[l - 2] != ':' || message[l - 1] != ' ')
|
if (l < 2 || message[l - 2] != ':' || message[l - 1] != ' ')
|
||||||
@@ -418,8 +421,10 @@ duplicate_rule_directive (char const *directive,
|
|||||||
location first, location second)
|
location first, location second)
|
||||||
{
|
{
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
complain_indent (&second, complaint, &i, _("only one %s allowed per rule"), directive);
|
complain_indent (&second, complaint, &i,
|
||||||
|
_("only one %s allowed per rule"), directive);
|
||||||
i += SUB_INDENT;
|
i += SUB_INDENT;
|
||||||
complain_indent (&first, complaint, &i, _("previous declaration"));
|
complain_indent (&first, complaint, &i,
|
||||||
|
_("previous declaration"));
|
||||||
fixits_register (&second, "");
|
fixits_register (&second, "");
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -287,7 +287,7 @@ Operation modes:\n\
|
|||||||
and exit\n\
|
and exit\n\
|
||||||
--print-datadir output directory containing skeletons and XSLT\n\
|
--print-datadir output directory containing skeletons and XSLT\n\
|
||||||
and exit\n\
|
and exit\n\
|
||||||
-u, --update apply fixes to the source grammar file\n\
|
-u, --update apply fixes to the source grammar file and exit\n\
|
||||||
-y, --yacc emulate POSIX Yacc\n\
|
-y, --yacc emulate POSIX Yacc\n\
|
||||||
-W, --warnings[=CATEGORY] report the warnings falling in CATEGORY\n\
|
-W, --warnings[=CATEGORY] report the warnings falling in CATEGORY\n\
|
||||||
-f, --feature[=FEATURE] activate miscellaneous features\n\
|
-f, --feature[=FEATURE] activate miscellaneous features\n\
|
||||||
@@ -708,7 +708,7 @@ getargs (int argc, char *argv[])
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'y':
|
case 'y':
|
||||||
warning_argmatch ("error=yacc", 0, 6);
|
warning_argmatch ("yacc", 0, 0);
|
||||||
yacc_loc = command_line_location ();
|
yacc_loc = command_line_location ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -329,7 +329,7 @@ state_lookahead_tokens_count (state *s, bool default_reduction_only_for_accept)
|
|||||||
&& default_reduction_only_for_accept))
|
&& default_reduction_only_for_accept))
|
||||||
n_lookahead_tokens += rp->num;
|
n_lookahead_tokens += rp->num;
|
||||||
else
|
else
|
||||||
s->consistent = 1;
|
s->consistent = true;
|
||||||
|
|
||||||
return n_lookahead_tokens;
|
return n_lookahead_tokens;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,6 +155,8 @@ main (int argc, char *argv[])
|
|||||||
|
|
||||||
print_precedence_warnings ();
|
print_precedence_warnings ();
|
||||||
|
|
||||||
|
if (!update_flag)
|
||||||
|
{
|
||||||
/* Output file names. */
|
/* Output file names. */
|
||||||
compute_output_file_names ();
|
compute_output_file_names ();
|
||||||
|
|
||||||
@@ -181,6 +183,7 @@ main (int argc, char *argv[])
|
|||||||
print_xml ();
|
print_xml ();
|
||||||
timevar_pop (tv_xml);
|
timevar_pop (tv_xml);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Stop if there were errors, to avoid trashing previous output
|
/* Stop if there were errors, to avoid trashing previous output
|
||||||
files. */
|
files. */
|
||||||
@@ -193,9 +196,12 @@ main (int argc, char *argv[])
|
|||||||
timevar_pop (tv_free);
|
timevar_pop (tv_free);
|
||||||
|
|
||||||
/* Output the tables and the parser to ftable. In file output. */
|
/* Output the tables and the parser to ftable. In file output. */
|
||||||
|
if (!update_flag)
|
||||||
|
{
|
||||||
timevar_push (tv_parser);
|
timevar_push (tv_parser);
|
||||||
output ();
|
output ();
|
||||||
timevar_pop (tv_parser);
|
timevar_pop (tv_parser);
|
||||||
|
}
|
||||||
|
|
||||||
timevar_push (tv_free);
|
timevar_push (tv_free);
|
||||||
nullable_free ();
|
nullable_free ();
|
||||||
|
|||||||
+11
-5
@@ -520,22 +520,28 @@ muscle_percent_define_insert (char const *var, location variable_loc,
|
|||||||
|
|
||||||
/* Command-line options are processed before the grammar file. */
|
/* Command-line options are processed before the grammar file. */
|
||||||
bool warned = false;
|
bool warned = false;
|
||||||
if (how == MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE
|
if (how == MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE)
|
||||||
&& muscle_find_const (name))
|
|
||||||
{
|
{
|
||||||
muscle_percent_define_how how_old = atoi (muscle_find_const (how_name));
|
char const *current_value = muscle_find_const (name);
|
||||||
|
if (current_value)
|
||||||
|
{
|
||||||
|
muscle_percent_define_how how_old
|
||||||
|
= atoi (muscle_find_const (how_name));
|
||||||
if (how_old == MUSCLE_PERCENT_DEFINE_F)
|
if (how_old == MUSCLE_PERCENT_DEFINE_F)
|
||||||
goto end;
|
goto end;
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
complain_indent (&variable_loc, complaint, &i,
|
/* If assigning the same value, make it a warning. */
|
||||||
|
warnings warn = STREQ (value, current_value) ? Wother : complaint;
|
||||||
|
complain_indent (&variable_loc, warn, &i,
|
||||||
_("%%define variable %s redefined"),
|
_("%%define variable %s redefined"),
|
||||||
quote (variable));
|
quote (variable));
|
||||||
i += SUB_INDENT;
|
i += SUB_INDENT;
|
||||||
location loc = muscle_percent_define_get_loc (variable);
|
location loc = muscle_percent_define_get_loc (variable);
|
||||||
complain_indent (&loc, complaint, &i, _("previous definition"));
|
complain_indent (&loc, warn, &i, _("previous definition"));
|
||||||
fixits_register (&variable_loc, "");
|
fixits_register (&variable_loc, "");
|
||||||
warned = true;
|
warned = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!warned && old && upd)
|
if (!warned && old && upd)
|
||||||
deprecated_directive (&variable_loc, old, upd);
|
deprecated_directive (&variable_loc, old, upd);
|
||||||
|
|||||||
+1
-1
@@ -143,7 +143,7 @@ state_new (symbol_number accessing_symbol,
|
|||||||
res->reductions = NULL;
|
res->reductions = NULL;
|
||||||
res->errs = NULL;
|
res->errs = NULL;
|
||||||
res->state_list = NULL;
|
res->state_list = NULL;
|
||||||
res->consistent = 0;
|
res->consistent = false;
|
||||||
res->solved_conflicts = NULL;
|
res->solved_conflicts = NULL;
|
||||||
res->solved_conflicts_xml = NULL;
|
res->solved_conflicts_xml = NULL;
|
||||||
|
|
||||||
|
|||||||
+5
-3
@@ -81,6 +81,8 @@
|
|||||||
#ifndef STATE_H_
|
#ifndef STATE_H_
|
||||||
# define STATE_H_
|
# define STATE_H_
|
||||||
|
|
||||||
|
# include <stdbool.h>
|
||||||
|
|
||||||
# include <bitset.h>
|
# include <bitset.h>
|
||||||
|
|
||||||
# include "gram.h"
|
# include "gram.h"
|
||||||
@@ -208,9 +210,9 @@ struct state
|
|||||||
store in this member a reference to the node containing each state. */
|
store in this member a reference to the node containing each state. */
|
||||||
struct state_list *state_list;
|
struct state_list *state_list;
|
||||||
|
|
||||||
/* If non-zero, then no lookahead sets on reduce actions are needed to
|
/* Whether no lookahead sets on reduce actions are needed to decide
|
||||||
decide what to do in state S. */
|
what to do in state S. */
|
||||||
char consistent;
|
bool consistent;
|
||||||
|
|
||||||
/* If some conflicts were solved thanks to precedence/associativity,
|
/* If some conflicts were solved thanks to precedence/associativity,
|
||||||
a human readable description of the resolution. */
|
a human readable description of the resolution. */
|
||||||
|
|||||||
+9
-7
@@ -543,7 +543,7 @@ AT_DATA_GRAMMAR([[input.y]],
|
|||||||
|
|
||||||
#define YYINITDEPTH 10
|
#define YYINITDEPTH 10
|
||||||
#define YYMAXDEPTH 10
|
#define YYMAXDEPTH 10
|
||||||
#define RANGE(Location) ]AT_LALR1_CC_IF([(Location).begin.line, (Location).end.line],
|
#define RANGE(Location) ]AT_CXX_IF([(Location).begin.line, (Location).end.line],
|
||||||
[(Location).first_line, (Location).last_line])[
|
[(Location).first_line, (Location).last_line])[
|
||||||
|
|
||||||
#define USE(SYM)
|
#define USE(SYM)
|
||||||
@@ -572,7 +572,7 @@ AT_LALR1_CC_IF([typedef yy::location YYLTYPE;])[
|
|||||||
/* FIXME: This %printer isn't actually tested. */
|
/* FIXME: This %printer isn't actually tested. */
|
||||||
%printer
|
%printer
|
||||||
{
|
{
|
||||||
]AT_LALR1_CC_IF([yyo << $$;],
|
]AT_CXX_IF([yyo << $$;],
|
||||||
[fprintf (yyo, "%d", $$)])[;
|
[fprintf (yyo, "%d", $$)])[;
|
||||||
}
|
}
|
||||||
'(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END
|
'(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END
|
||||||
@@ -734,9 +734,8 @@ static
|
|||||||
fprintf (stderr, " (%d@%d-%d)\n", c, RANGE (]AT_LOC[));
|
fprintf (stderr, " (%d@%d-%d)\n", c, RANGE (]AT_LOC[));
|
||||||
return source[c];
|
return source[c];
|
||||||
}
|
}
|
||||||
]AT_LALR1_CC_IF(
|
]AT_LALR1_CC_IF([static bool yydebug;])[
|
||||||
[static bool yydebug;
|
]AT_CXX_IF([int
|
||||||
int
|
|
||||||
yyparse ()
|
yyparse ()
|
||||||
{
|
{
|
||||||
yy::parser parser;
|
yy::parser parser;
|
||||||
@@ -999,11 +998,14 @@ AT_CLEANUP
|
|||||||
AT_CHECK_PRINTER_AND_DESTRUCTOR([])
|
AT_CHECK_PRINTER_AND_DESTRUCTOR([])
|
||||||
AT_CHECK_PRINTER_AND_DESTRUCTOR([], [ with union])
|
AT_CHECK_PRINTER_AND_DESTRUCTOR([], [ with union])
|
||||||
|
|
||||||
|
AT_CHECK_PRINTER_AND_DESTRUCTOR([%glr-parser])
|
||||||
|
AT_CHECK_PRINTER_AND_DESTRUCTOR([%glr-parser], [ with union])
|
||||||
|
|
||||||
AT_CHECK_PRINTER_AND_DESTRUCTOR([%defines %skeleton "lalr1.cc"])
|
AT_CHECK_PRINTER_AND_DESTRUCTOR([%defines %skeleton "lalr1.cc"])
|
||||||
AT_CHECK_PRINTER_AND_DESTRUCTOR([%defines %skeleton "lalr1.cc"], [ with union])
|
AT_CHECK_PRINTER_AND_DESTRUCTOR([%defines %skeleton "lalr1.cc"], [ with union])
|
||||||
|
|
||||||
AT_CHECK_PRINTER_AND_DESTRUCTOR([%glr-parser])
|
AT_CHECK_PRINTER_AND_DESTRUCTOR([%defines %skeleton "glr.cc"])
|
||||||
AT_CHECK_PRINTER_AND_DESTRUCTOR([%glr-parser], [ with union])
|
AT_CHECK_PRINTER_AND_DESTRUCTOR([%defines %skeleton "glr.cc"], [ with union])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -330,6 +330,7 @@ AT_CHECK([[$PERL -n -0777 -e '
|
|||||||
|YY_MOVE_OR_COPY
|
|YY_MOVE_OR_COPY
|
||||||
|YY_MOVE_REF
|
|YY_MOVE_REF
|
||||||
|YY_NOEXCEPT
|
|YY_NOEXCEPT
|
||||||
|
|YY_NOTHROW
|
||||||
|YY_NULLPTR
|
|YY_NULLPTR
|
||||||
|YY_RVREF
|
|YY_RVREF
|
||||||
|YY_\w+_INCLUDED
|
|YY_\w+_INCLUDED
|
||||||
|
|||||||
+44
-41
@@ -1402,15 +1402,15 @@ without_period: "WITHOUT.PERIOD";
|
|||||||
AT_BISON_OPTION_POPDEFS
|
AT_BISON_OPTION_POPDEFS
|
||||||
|
|
||||||
# POSIX Yacc accept periods, but not dashes.
|
# POSIX Yacc accept periods, but not dashes.
|
||||||
AT_BISON_CHECK([--yacc input.y], [1], [],
|
AT_BISON_CHECK([--yacc input.y], [], [],
|
||||||
[[input.y:1.1-5: error: POSIX Yacc does not support %code [-Werror=yacc]
|
[[input.y:1.1-5: warning: POSIX Yacc does not support %code [-Wyacc]
|
||||||
input.y:9.8-16: error: POSIX Yacc forbids dashes in symbol names: WITH-DASH [-Werror=yacc]
|
input.y:9.8-16: warning: POSIX Yacc forbids dashes in symbol names: WITH-DASH [-Wyacc]
|
||||||
input.y:10.21-34: error: POSIX Yacc does not support string literals [-Werror=yacc]
|
input.y:10.21-34: warning: POSIX Yacc does not support string literals [-Wyacc]
|
||||||
input.y:12.23-38: error: POSIX Yacc does not support string literals [-Werror=yacc]
|
input.y:12.23-38: warning: POSIX Yacc does not support string literals [-Wyacc]
|
||||||
input.y:13.1-5: error: POSIX Yacc does not support %code [-Werror=yacc]
|
input.y:13.1-5: warning: POSIX Yacc does not support %code [-Wyacc]
|
||||||
input.y:20.8-16: error: POSIX Yacc forbids dashes in symbol names: with-dash [-Werror=yacc]
|
input.y:20.8-16: warning: POSIX Yacc forbids dashes in symbol names: with-dash [-Wyacc]
|
||||||
input.y:22.15-28: error: POSIX Yacc does not support string literals [-Werror=yacc]
|
input.y:22.15-28: warning: POSIX Yacc does not support string literals [-Wyacc]
|
||||||
input.y:24.17-32: error: POSIX Yacc does not support string literals [-Werror=yacc]
|
input.y:24.17-32: warning: POSIX Yacc does not support string literals [-Wyacc]
|
||||||
]])
|
]])
|
||||||
|
|
||||||
# Dashes are fine for GNU Bison.
|
# Dashes are fine for GNU Bison.
|
||||||
@@ -1740,7 +1740,7 @@ start: %empty;
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
AT_BISON_CHECK([[input-redefined.y]], [[1]], [],
|
AT_BISON_CHECK([[input-redefined.y]], [[1]], [],
|
||||||
[[input-redefined.y:2.1-20: error: %define variable 'var' redefined
|
[[input-redefined.y:2.1-20: warning: %define variable 'var' redefined [-Wother]
|
||||||
input-redefined.y:1.1-20: previous definition
|
input-redefined.y:1.1-20: previous definition
|
||||||
input-redefined.y:3.2-21: error: %define variable 'var' redefined
|
input-redefined.y:3.2-21: error: %define variable 'var' redefined
|
||||||
input-redefined.y:2.1-20: previous definition
|
input-redefined.y:2.1-20: previous definition
|
||||||
@@ -1992,7 +1992,6 @@ AT_DATA([[input.y]],
|
|||||||
[[%define api.push_pull both
|
[[%define api.push_pull both
|
||||||
%define lr.keep_unreachable_states maybe
|
%define lr.keep_unreachable_states maybe
|
||||||
%define namespace "foo"
|
%define namespace "foo"
|
||||||
%define api.namespace {foo}
|
|
||||||
%define variant
|
%define variant
|
||||||
%define parser_class_name {parser}
|
%define parser_class_name {parser}
|
||||||
%%
|
%%
|
||||||
@@ -2008,18 +2007,15 @@ input.y:2.1-40: warning: deprecated directive, use '%define lr.keep-unreachable-
|
|||||||
input.y:3.1-23: warning: deprecated directive, use '%define api.namespace {foo}' [-Wdeprecated]
|
input.y:3.1-23: warning: deprecated directive, use '%define api.namespace {foo}' [-Wdeprecated]
|
||||||
%define namespace "foo"
|
%define namespace "foo"
|
||||||
^~~~~~~~~~~~~~~~~~~~~~~
|
^~~~~~~~~~~~~~~~~~~~~~~
|
||||||
input.y:4.1-27: error: %define variable 'api.namespace' redefined
|
input.y:4.1-15: warning: deprecated directive, use '%define api.value.type variant' [-Wdeprecated]
|
||||||
%define api.namespace {foo}
|
|
||||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
input.y:3.1-23: previous definition
|
|
||||||
%define namespace "foo"
|
|
||||||
^~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
input.y:5.1-15: warning: deprecated directive, use '%define api.value.type variant' [-Wdeprecated]
|
|
||||||
%define variant
|
%define variant
|
||||||
^~~~~~~~~~~~~~~
|
^~~~~~~~~~~~~~~
|
||||||
input.y:6.1-34: warning: deprecated directive, use '%define api.parser.class {parser}' [-Wdeprecated]
|
input.y:5.1-34: warning: deprecated directive, use '%define api.parser.class {parser}' [-Wdeprecated]
|
||||||
%define parser_class_name {parser}
|
%define parser_class_name {parser}
|
||||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
input.y:2.1-40: error: invalid value for %define Boolean variable 'lr.keep-unreachable-state'
|
||||||
|
%define lr.keep_unreachable_states maybe
|
||||||
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
|
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
|
||||||
]])
|
]])
|
||||||
|
|
||||||
@@ -2337,8 +2333,8 @@ AT_CLEANUP
|
|||||||
|
|
||||||
AT_SETUP([[Redefined %union name]])
|
AT_SETUP([[Redefined %union name]])
|
||||||
|
|
||||||
# AT_TEST(DIRECTIVES, ERROR)
|
# AT_TEST(DIRECTIVES, EXIT-STATUS, ERROR)
|
||||||
# --------------------------
|
# ---------------------------------------
|
||||||
m4_pushdef([AT_TEST],
|
m4_pushdef([AT_TEST],
|
||||||
[AT_DATA([[input.y]],
|
[AT_DATA([[input.y]],
|
||||||
[$1
|
[$1
|
||||||
@@ -2346,27 +2342,28 @@ m4_pushdef([AT_TEST],
|
|||||||
exp: %empty;
|
exp: %empty;
|
||||||
])
|
])
|
||||||
|
|
||||||
AT_BISON_CHECK([[input.y]], [[1]], [[]],
|
AT_BISON_CHECK([[input.y]], [$2], [[]],
|
||||||
[$2])
|
[$3])
|
||||||
])
|
])
|
||||||
|
|
||||||
AT_TEST([[%union foo {};
|
AT_TEST([[%union foo {};
|
||||||
%union {};
|
%union {};
|
||||||
%union foo {};
|
%union foo {};
|
||||||
%define api.value.union.name foo]],
|
%define api.value.union.name foo]],
|
||||||
[[input.y:3.8-10: error: %define variable 'api.value.union.name' redefined
|
[0],
|
||||||
|
[[input.y:3.8-10: warning: %define variable 'api.value.union.name' redefined [-Wother]
|
||||||
input.y:1.8-10: previous definition
|
input.y:1.8-10: previous definition
|
||||||
input.y:4.1-32: error: %define variable 'api.value.union.name' redefined
|
input.y:4.1-32: warning: %define variable 'api.value.union.name' redefined [-Wother]
|
||||||
input.y:3.8-10: previous definition
|
input.y:3.8-10: previous definition
|
||||||
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
|
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AT_TEST([[%define api.value.union.name {foo}]],
|
AT_TEST([[%define api.value.union.name {foo}]], [1],
|
||||||
[[input.y:1.1-34: error: %define variable 'api.value.union.name' requires keyword values
|
[[input.y:1.1-34: error: %define variable 'api.value.union.name' requires keyword values
|
||||||
input.y:1.1-34: error: %define variable 'api.value.union.name' is not used
|
input.y:1.1-34: error: %define variable 'api.value.union.name' is not used
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AT_TEST([[%define api.value.union.name "foo"]],
|
AT_TEST([[%define api.value.union.name "foo"]], [1],
|
||||||
[[input.y:1.1-34: error: %define variable 'api.value.union.name' requires keyword values
|
[[input.y:1.1-34: error: %define variable 'api.value.union.name' requires keyword values
|
||||||
input.y:1.1-34: error: %define variable 'api.value.union.name' is not used
|
input.y:1.1-34: error: %define variable 'api.value.union.name' is not used
|
||||||
]])
|
]])
|
||||||
@@ -2503,7 +2500,7 @@ AT_DATA_GRAMMAR([[input.y]],
|
|||||||
%no-default_prec
|
%no-default_prec
|
||||||
%no_default-prec
|
%no_default-prec
|
||||||
%no_lines
|
%no_lines
|
||||||
%output = "foo"
|
%output = "output.c"
|
||||||
%pure_parser
|
%pure_parser
|
||||||
%token_table
|
%token_table
|
||||||
%error-verbose
|
%error-verbose
|
||||||
@@ -2523,15 +2520,15 @@ fix-it:"input.y":{12:1-12:11}:"%expect-rr"
|
|||||||
input.y:13.1-14: warning: deprecated directive: '%file-prefix =', use '%file-prefix' [-Wdeprecated]
|
input.y:13.1-14: warning: deprecated directive: '%file-prefix =', use '%file-prefix' [-Wdeprecated]
|
||||||
fix-it:"input.y":{13:1-13:15}:"%file-prefix"
|
fix-it:"input.y":{13:1-13:15}:"%file-prefix"
|
||||||
input.y:14.1-16.5: warning: duplicate directive: '%file-prefix\n =' [-Wother]
|
input.y:14.1-16.5: warning: duplicate directive: '%file-prefix\n =' [-Wother]
|
||||||
input.y:13.1-20: previous declaration [-Wother]
|
input.y:13.1-20: previous declaration
|
||||||
fix-it:"input.y":{14:1-16:6}:""
|
fix-it:"input.y":{14:1-16:6}:""
|
||||||
input.y:17.1-19: warning: deprecated directive: '%fixed-output_files', use '%fixed-output-files' [-Wdeprecated]
|
input.y:17.1-19: warning: deprecated directive: '%fixed-output_files', use '%fixed-output-files' [-Wdeprecated]
|
||||||
fix-it:"input.y":{17:1-17:20}:"%fixed-output-files"
|
fix-it:"input.y":{17:1-17:20}:"%fixed-output-files"
|
||||||
input.y:18.1-19: warning: duplicate directive: '%fixed_output-files' [-Wother]
|
input.y:18.1-19: warning: duplicate directive: '%fixed_output-files' [-Wother]
|
||||||
input.y:17.1-19: previous declaration [-Wother]
|
input.y:17.1-19: previous declaration
|
||||||
fix-it:"input.y":{18:1-18:20}:""
|
fix-it:"input.y":{18:1-18:20}:""
|
||||||
input.y:19.1-19: warning: duplicate directive: '%fixed-output-files' [-Wother]
|
input.y:19.1-19: warning: duplicate directive: '%fixed-output-files' [-Wother]
|
||||||
input.y:17.1-19: previous declaration [-Wother]
|
input.y:17.1-19: previous declaration
|
||||||
fix-it:"input.y":{19:1-19:20}:""
|
fix-it:"input.y":{19:1-19:20}:""
|
||||||
input.y:20.1-19: warning: deprecated directive: '%name-prefix= "foo"', use '%define api.prefix {foo}' [-Wdeprecated]
|
input.y:20.1-19: warning: deprecated directive: '%name-prefix= "foo"', use '%define api.prefix {foo}' [-Wdeprecated]
|
||||||
fix-it:"input.y":{20:1-20:20}:"%define api.prefix {foo}"
|
fix-it:"input.y":{20:1-20:20}:"%define api.prefix {foo}"
|
||||||
@@ -2547,30 +2544,35 @@ input.y:25.1-12: warning: deprecated directive: '%pure_parser', use '%pure-parse
|
|||||||
fix-it:"input.y":{25:1-25:13}:"%pure-parser"
|
fix-it:"input.y":{25:1-25:13}:"%pure-parser"
|
||||||
input.y:26.1-12: warning: deprecated directive: '%token_table', use '%token-table' [-Wdeprecated]
|
input.y:26.1-12: warning: deprecated directive: '%token_table', use '%token-table' [-Wdeprecated]
|
||||||
fix-it:"input.y":{26:1-26:13}:"%token-table"
|
fix-it:"input.y":{26:1-26:13}:"%token-table"
|
||||||
input.y:27.1-14: error: %define variable 'parse.error' redefined
|
input.y:27.1-14: warning: %define variable 'parse.error' redefined [-Wother]
|
||||||
input.y:11.1-14: previous definition
|
input.y:11.1-14: previous definition
|
||||||
fix-it:"input.y":{27:1-27:15}:""
|
fix-it:"input.y":{27:1-27:15}:""
|
||||||
input.y:29.1-18: warning: duplicate directive: '%name-prefix "bar"' [-Wother]
|
input.y:29.1-18: warning: duplicate directive: '%name-prefix "bar"' [-Wother]
|
||||||
input.y:13.1-20: previous declaration [-Wother]
|
input.y:13.1-20: previous declaration
|
||||||
fix-it:"input.y":{29:1-29:19}:""
|
fix-it:"input.y":{29:1-29:19}:""
|
||||||
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
|
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AT_CHECK([cp errors-all experr])
|
AT_CHECK([cp errors-all experr])
|
||||||
AT_BISON_CHECK([[-ffixit input.y]], [[1]], [[]], [experr])
|
AT_BISON_CHECK([[-ffixit input.y]], [], [], [experr])
|
||||||
|
|
||||||
AT_CHECK([[sed -e '/^fix-it:/d' errors-all >experr]])
|
AT_CHECK([[sed -e '/^fix-it:/d' errors-all >experr]])
|
||||||
AT_BISON_CHECK([[input.y]], [[1]], [[]], [experr])
|
AT_BISON_CHECK([[input.y]], [], [], [experr])
|
||||||
|
|
||||||
# Update the input file.
|
|
||||||
|
# Update the input file. Make sure we generated nothing.
|
||||||
|
AT_CHECK([rm -f output.c])
|
||||||
AT_CHECK([cp input.y input.y.orig])
|
AT_CHECK([cp input.y input.y.orig])
|
||||||
AT_CHECK([sed -e '/fix-it/d' <errors-all >experr])
|
AT_CHECK([sed -e '/fix-it/d' <errors-all >experr])
|
||||||
AT_CHECK([echo "bison: file 'input.y' was updated (backup: 'input.y~')" >>experr])
|
AT_CHECK([echo "bison: file 'input.y' was updated (backup: 'input.y~')" >>experr])
|
||||||
AT_BISON_CHECK([[--update input.y]], [[1]], [[]], [experr])
|
AT_BISON_CHECK([[--update input.y]], [], [[]], [experr])
|
||||||
|
|
||||||
# Check the backup.
|
# Check the backup.
|
||||||
AT_CHECK([diff input.y.orig input.y~])
|
AT_CHECK([diff input.y.orig input.y~])
|
||||||
|
|
||||||
|
# Check we did not generate any file.
|
||||||
|
AT_CHECK([test ! -f output.c])
|
||||||
|
|
||||||
# Check the update.
|
# Check the update.
|
||||||
AT_CHECK([cat input.y], [],
|
AT_CHECK([cat input.y], [],
|
||||||
[[%code top {
|
[[%code top {
|
||||||
@@ -2591,7 +2593,7 @@ AT_CHECK([cat input.y], [],
|
|||||||
%no-default-prec
|
%no-default-prec
|
||||||
%no-default-prec
|
%no-default-prec
|
||||||
%no-lines
|
%no-lines
|
||||||
%output "foo"
|
%output "output.c"
|
||||||
%pure-parser
|
%pure-parser
|
||||||
%token-table
|
%token-table
|
||||||
%glr-parser
|
%glr-parser
|
||||||
@@ -2632,10 +2634,11 @@ AT_BISON_CHECK([[input.y]], [[1]], [[]],
|
|||||||
input.y:11.15-24: warning: deprecated directive: '%expect_rr', use '%expect-rr' [-Wdeprecated]
|
input.y:11.15-24: warning: deprecated directive: '%expect_rr', use '%expect-rr' [-Wdeprecated]
|
||||||
input.y:12.15-24: warning: deprecated directive: '%expect_rr', use '%expect-rr' [-Wdeprecated]
|
input.y:12.15-24: warning: deprecated directive: '%expect_rr', use '%expect-rr' [-Wdeprecated]
|
||||||
input.y:13.1-14: warning: deprecated directive: '%error_verbose', use '%define parse.error verbose' [-Wdeprecated]
|
input.y:13.1-14: warning: deprecated directive: '%error_verbose', use '%define parse.error verbose' [-Wdeprecated]
|
||||||
input.y:13.16-29: error: %define variable 'parse.error' redefined
|
input.y:13.16-29: warning: %define variable 'parse.error' redefined [-Wother]
|
||||||
input.y:13.1-14: previous definition
|
input.y:13.1-14: previous definition
|
||||||
input.y:14.16-29: error: %define variable 'parse.error' redefined
|
input.y:14.16-29: warning: %define variable 'parse.error' redefined [-Wother]
|
||||||
input.y:13.16-29: previous definition
|
input.y:13.16-29: previous definition
|
||||||
|
input.y: error: reduce/reduce conflicts: 0 found, 42 expected
|
||||||
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
|
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
|
||||||
]])
|
]])
|
||||||
|
|
||||||
@@ -2669,7 +2672,7 @@ AT_DATA_GRAMMAR([[input.y]],
|
|||||||
|
|
||||||
AT_BISON_CHECK([[input.y]], [[0]], [[]],
|
AT_BISON_CHECK([[input.y]], [[0]], [[]],
|
||||||
[[input.y:14.1-15.5: warning: duplicate directive: '%file-prefix' [-Wother]
|
[[input.y:14.1-15.5: warning: duplicate directive: '%file-prefix' [-Wother]
|
||||||
input.y:13.1-18: previous declaration [-Wother]
|
input.y:13.1-18: previous declaration
|
||||||
input.y: warning: %expect-rr applies only to GLR parsers [-Wother]
|
input.y: warning: %expect-rr applies only to GLR parsers [-Wother]
|
||||||
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
|
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
|
||||||
]])
|
]])
|
||||||
|
|||||||
Reference in New Issue
Block a user