[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: merge maint into master
From: |
Akim Demaille |
Subject: |
FYI: merge maint into master |
Date: |
Thu, 19 Sep 2013 16:37:26 +0200 |
commit 4f3cc9c21b69f11b7513f617871fc611a190ab00
Merge: 55a2063 77482f2
Author: Akim Demaille <address@hidden>
Date: Thu Sep 19 16:33:20 2013 +0200
Merge remote-tracking branch 'origin/maint'
* origin/maint:
glr: more assertions
glr: shorten scopes
glr: formatting changes
glr: better use of tracing macros
examples: improve the output of the "variant" example
variant: remove useless assertion
tests: remove stray debugging traces
tests: do not use grep -q
build: don't require flex for ordinary builds
maint: update .gitignore
build: port to pre-5.8.7 perl
tests: minor change to make it easier to test other skeletons
uniqstr: fix assertion
diff --git a/.gitignore b/.gitignore
index bfb7caf..e9708d3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,14 @@
+*.eps
+*.o
+*.pdf
+*.png
+*.stamp
+*~
+.deps
+.dirstamp
/*.cache
/*.flc
/*.prj
-/*~
/.tarball-version
/.version
/ABOUT-NLS
diff --git a/NEWS b/NEWS
index 07bf5a9..bbdcc0f 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ GNU Bison NEWS
* Noteworthy changes in release ?.? (????-??-??) [?]
+** Bug fixes
+
+ Portability issues in the test suite.
* Noteworthy changes in release 3.0 (2013-07-25) [stable]
diff --git a/THANKS b/THANKS
index 321a8b8..2d4a6a9 100644
--- a/THANKS
+++ b/THANKS
@@ -31,6 +31,7 @@ Cris van Pelt address@hidden
Csaba Raduly address@hidden
Dagobert Michelsen address@hidden
Daniel Frużyński address@hidden
+Daniel Galloway address@hidden
Daniel Hagerty address@hidden
David J. MacKenzie address@hidden
David Kastrup address@hidden
diff --git a/configure.ac b/configure.ac
index f7319a1..992e203 100644
--- a/configure.ac
+++ b/configure.ac
@@ -175,7 +175,10 @@ AC_SUBST([YACC_LIBRARY])
# Checks for programs.
AM_MISSING_PROG([DOT], [dot])
AC_PROG_LEX
-$LEX_IS_FLEX || AC_MSG_ERROR([Flex is required])
+$LEX_IS_FLEX || test "X$LEX" = X: || {
+ AC_MSG_WARN([bypassing lex because flex is required])
+ LEX=:
+}
AC_PROG_YACC
AC_PROG_RANLIB
AC_PROG_GNU_M4
diff --git a/data/glr.c b/data/glr.c
index 895a69e..1f8f0b3 100644
--- a/data/glr.c
+++ b/data/glr.c
@@ -836,12 +836,10 @@ yydestroyGLRState (char const *yymsg, yyGLRState
*yys]b4_user_formals[)
if (yydebug)
{
if (yys->yysemantics.yyfirstVal)
- YYFPRINTF (stderr, "%s unresolved ", yymsg);
+ YYFPRINTF (stderr, "%s unresolved", yymsg);
else
- YYFPRINTF (stderr, "%s incomplete ", yymsg);
- yy_symbol_print (stderr, yystos[yys->yylrState],
- YY_NULL]b4_locuser_args([&yys->yyloc])[);
- YYFPRINTF (stderr, "\n");
+ YYFPRINTF (stderr, "%s incomplete", yymsg);
+ YY_SYMBOL_PRINT ("", yystos[yys->yylrState], YY_NULL, &yys->yyloc);
}
#endif
@@ -966,6 +964,7 @@ yyaddDeferredAction (yyGLRStack* yystackp, size_t yyk,
yyGLRState* yystate,
{
yySemanticOption* yynewOption =
&yynewGLRStackItem (yystackp, yyfalse)->yyoption;
+ YYASSERT (!yynewOption->yyisState);
yynewOption->yystate = yyrhs;
yynewOption->yyrule = yyrule;
if (yystackp->yytops.yylookaheadNeeds[yyk])
@@ -1082,7 +1081,7 @@ yyexpandGLRStack (yyGLRStack* yystackp)
}
if (yystackp->yysplitPoint != YY_NULL)
yystackp->yysplitPoint = YYRELOC (yystackp->yyitems, yynewItems,
- yystackp->yysplitPoint, yystate);
+ yystackp->yysplitPoint, yystate);
for (yyn = 0; yyn < yystackp->yytops.yysize; yyn += 1)
if (yystackp->yytops.yystates[yyn] != YY_NULL)
@@ -1201,6 +1200,7 @@ yyglrShiftDefer (yyGLRStack* yystackp, size_t yyk,
yyStateNum yylrState,
size_t yyposn, yyGLRState* yyrhs, yyRuleNum yyrule)
{
yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate;
+ YYASSERT (yynewState->yyisState);
yynewState->yylrState = yylrState;
yynewState->yyposn = yyposn;
@@ -1320,11 +1320,10 @@ yyglrReduce (yyGLRStack* yystackp, size_t yyk,
yyRuleNum yyrule,
if (yyforceEval || yystackp->yysplitPoint == YY_NULL)
{
- YYRESULTTAG yyflag;
- YYSTYPE yysval;]b4_locations_if([
- YYLTYPE yyloc;])[
+ YYSTYPE yysval;]b4_locations_if([[
+ YYLTYPE yyloc;]])[
- yyflag = yydoAction (yystackp, yyk, yyrule,
&yysval]b4_locuser_args([&yyloc])[);
+ YYRESULTTAG yyflag = yydoAction (yystackp, yyk, yyrule,
&yysval]b4_locuser_args([&yyloc])[);
if (yyflag == yyerr && yystackp->yysplitPoint != YY_NULL)
{
YYDPRINTF ((stderr, "Parse on stack %lu rejected by rule #%d.\n",
@@ -2493,6 +2492,8 @@ yypdumpstack (yyGLRStack* yystackp)
(unsigned long int) (yyp - yystackp->yyitems));
if (*(yybool *) yyp)
{
+ YYASSERT (yyp->yystate.yyisState);
+ YYASSERT (yyp->yyoption.yyisState);
YYFPRINTF (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
yyp->yystate.yyresolved, yyp->yystate.yylrState,
(unsigned long int) yyp->yystate.yyposn,
@@ -2504,6 +2505,8 @@ yypdumpstack (yyGLRStack* yystackp)
}
else
{
+ YYASSERT (!yyp->yystate.yyisState);
+ YYASSERT (!yyp->yyoption.yyisState);
YYFPRINTF (stderr, "Option. rule: %d, state: %ld, next: %ld",
yyp->yyoption.yyrule - 1,
(long int) YYINDEX (yyp->yyoption.yystate),
diff --git a/data/variant.hh b/data/variant.hh
index ac4f7a7..19538f6 100644
--- a/data/variant.hh
+++ b/data/variant.hh
@@ -178,8 +178,7 @@ m4_define([b4_variant_define],
template <typename T>
void
move (self_type& other)
- {]b4_parse_assert_if([
- YYASSERT (!yytname_);])[
+ {
build<T> ();
swap<T> (other);
other.destroy<T> ();
diff --git a/examples/local.mk b/examples/local.mk
index 05e28e1..c79c800 100644
--- a/examples/local.mk
+++ b/examples/local.mk
@@ -25,7 +25,7 @@ AM_CXXFLAGS =
\
doc = $(top_srcdir)/doc/bison.texi
extexi = $(top_srcdir)/examples/extexi
-extract = VERSION="$(VERSION)" $(PERL) -f $(extexi) $(doc) --
+extract = VERSION="$(VERSION)" $(PERL) $(extexi) $(doc) --
extracted =
CLEANFILES += $(extracted) examples/extracted.stamp
examples/extracted.stamp: $(doc) $(extexi)
diff --git a/examples/variant.yy b/examples/variant.yy
index 9413cbc..fd551cc 100644
--- a/examples/variant.yy
+++ b/examples/variant.yy
@@ -16,7 +16,7 @@
*/
%debug
-%skeleton "lalr1.cc"
+%language "c++"
%defines
%define api.token.constructor
%define api.value.type variant
@@ -48,11 +48,17 @@ typedef std::list<std::string> strings_type;
namespace std
{
std::ostream&
- operator<< (std::ostream& o, const strings_type& s)
+ operator<< (std::ostream& o, const strings_type& ss)
{
- std::copy (s.begin (), s.end (),
- std::ostream_iterator<strings_type::value_type> (o, "\n"));
- return o;
+ o << "(" << &ss << ") {";
+ const char *sep = "";
+ for (strings_type::const_iterator i = ss.begin(), end = ss.end();
+ i != end; ++i)
+ {
+ o << sep << *i;
+ sep = ", ";
+ }
+ return o << "}";
}
}
diff --git a/src/uniqstr.c b/src/uniqstr.c
index 4446c0e..37345dc 100644
--- a/src/uniqstr.c
+++ b/src/uniqstr.c
@@ -77,7 +77,8 @@ uniqstr_vsprintf (char const *format, ...)
void
uniqstr_assert (char const *str)
{
- if (!hash_lookup (uniqstrs_table, str))
+ uniqstr *s = hash_lookup (uniqstrs_table, str);
+ if (!s || s != (uniqstr *)str)
{
error (0, 0,
"not a uniqstr: %s", quotearg (str));
diff --git a/tests/atlocal.in b/tests/atlocal.in
index 19ecfd7..0184ae1 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -72,13 +72,12 @@ int main ()
std::cout << "Works" << std::endl;
}
EOF
- ls
$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS $LIBS -o conftest conftest.cc
case $? in
0);;
*) BISON_CXX_WORKS="as_fn_error 77 cannot-compile-simple-program";;
esac
- rm -f conftest*
+ rm -fr conftest*
fi
# Whether the compiler supports POSIXLY_CORRECT defined.
diff --git a/tests/c++.at b/tests/c++.at
index 96f2ac1..e4c527c 100644
--- a/tests/c++.at
+++ b/tests/c++.at
@@ -174,11 +174,10 @@ AT_CLEANUP
m4_pushdef([AT_TEST],
[AT_SETUP([Variants $1])
-AT_BISON_OPTION_PUSHDEFS([%skeleton "lalr1.cc" %debug $1])
+AT_BISON_OPTION_PUSHDEFS([%debug $1])
# Store strings and integers in a list of strings.
AT_DATA_GRAMMAR([list.y],
[[%debug
-%skeleton "lalr1.cc"
%define api.value.type variant
]m4_bpatsubst([$1], [\\n], [
])[
@@ -320,13 +319,13 @@ AT_BISON_OPTION_POPDEFS
AT_CLEANUP
])
-AT_TEST([])
-AT_TEST([%define parse.assert])
-AT_TEST([%locations %define parse.assert])
-AT_TEST([[%define parse.assert %code {\n#define TWO_STAGE_BUILD\n}]])
-AT_TEST([[%define parse.assert %define api.token.constructor]])
-AT_TEST([[%define parse.assert %define api.token.constructor %define
api.token.prefix {TOK_}]])
-AT_TEST([[%locations %define parse.assert %define api.token.constructor
%define api.token.prefix {TOK_}]])
+AT_TEST([[%skeleton "lalr1.cc" ]])
+AT_TEST([[%skeleton "lalr1.cc" %define parse.assert]])
+AT_TEST([[%skeleton "lalr1.cc" %locations %define parse.assert]])
+AT_TEST([[%skeleton "lalr1.cc" %define parse.assert %code {\n#define
TWO_STAGE_BUILD\n}]])
+AT_TEST([[%skeleton "lalr1.cc" %define parse.assert %define
api.token.constructor]])
+AT_TEST([[%skeleton "lalr1.cc" %define parse.assert %define
api.token.constructor %define api.token.prefix {TOK_}]])
+AT_TEST([[%skeleton "lalr1.cc" %locations %define parse.assert %define
api.token.constructor %define api.token.prefix {TOK_}]])
m4_popdef([AT_TEST])
diff --git a/tests/java.at b/tests/java.at
index 2b20698..58998fe 100644
--- a/tests/java.at
+++ b/tests/java.at
@@ -725,18 +725,23 @@ AT_CLEANUP
AT_SETUP([Java constructor init and init_throws])
+m4_pushdef([AT_Witness],
+[super("Test Thread"); if (true) throw new InterruptedException();])
+
AT_CHECK_JAVA_MINIMAL([[
%define extends {Thread}
-%code init { super("Test Thread"); if (true) throw new InterruptedException();
}
+%code init { ]AT_Witness[ }
%define init_throws {InterruptedException}
%lex-param {int lex_param}]])
-AT_CHECK([[grep -q 'super("Test Thread"); if (true) throw new
InterruptedException();' YYParser.java]])
+AT_CHECK([[grep ']AT_Witness[' YYParser.java]], 0, [ignore])
AT_CHECK_JAVA_MINIMAL_W_LEXER([[
%define extends {Thread}
-%code init { super("Test Thread"); if (true) throw new InterruptedException();
}
+%code init { ]AT_Witness[ }
%define init_throws {InterruptedException}]], [], [[return EOF;]])
-AT_CHECK([[grep -q 'super("Test Thread"); if (true) throw new
InterruptedException();' YYParser.java]])
+AT_CHECK([[grep ']AT_Witness[' YYParser.java]], 0, [ignore])
+
+m4_popdef([AT_Witness])
AT_CLEANUP
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: merge maint into master,
Akim Demaille <=